Saturday, October 26, 2019

Apple IOS: How to backup health data to windows or MAC

This is an old post, but keeping it here for archival.

Before starting you need to have email correctly configured on your phone.
  1. Start the health app
  2. Navigate through "Health Data (folder with heart on it)" -> "All" -> Share icon in top right corner (the square box with the arrow on it).
  3. When you do that you will be prompted for confirmation as below:
    Health app prompting for confirmation before backing up
  4. Check your email. You should have the exported data in XML format.
Making sense of the XML data:
I found a note on an apple forum that neatly summarizes how you can view this information:
1) Open a blank Excel Workbook.
2) For Excel 2007 or more recent, choose the Data tab on the top.
3) On the left side there is a 'Get External Data' block of choices, click the dropdown arrow on 'From Other Sources'.
4) Click on the third choice 'From XML Data Import'.
5) Find your downloaded XML file and click 'Open'.
6) Excel will likely display a message that the source does not refer to a schema. Choose 'OK'.
7) If you click 'OK' with the default choice 'XML table in existing worksheet', data will be displayed in Excel table format, which will let you sort and filter data. The other choices only displays the data in columns.

You will likely need to create an additional column for dates, as the 'startDate' and 'endDate' times are in a format that Excel won't recognize, if you need any date to your data anyway. If you need a conversion formula you can reply to this message stating as much. You probably already found that the export zip file shows detailed logs for every day on an hourly basis for the last week only, prior records at least in the export are summarized by day.

Known issues:
I do not have a solution for any of these and I ran into them when I was backing up from my phone. So if you find something please comment.
  • Health app crashes (on startup)
  • Health app crashes while creating a backup.
  • Export is unsuccessful with the following screen seen below (could not export health data):
    Health app fails saying could not export data