iOS 14.4 & Restoring from Exports

Backstory: I’ve been using Arc since Dec 2019, its been working on and off OK since then.

In October my iPhone and Apple Watch desynchronised and I had to restore everything.

It was backed up to iCloud but since then its not restored anything before the date I restored my phone…

Thankfully before restoring I did do a Monthly GPX export, so I have all the data. However I can’t seem to get it to import anything going back that far.

Plus the automatic exports have now stopped on Dec 6th.

Having read around it seems iOS’s background limitations are strangling the app and that a new backup method is coming along.

So two questions then;

A) Does leaving the app open, with the screen on and plugged in allow the app to use all the resources it wants to complete all the iCloud Backups and monthly exports.

B) How do I get Arc to restore from the exported GPX files?


Edit: Looking at the GPX files themselves it seems they aren’t complete either up to the date of export, seems like I’ve lost most of the detail up to the date of restore…

You do indeed need a much better backup method!

Edit 2: It seems that I have the backup from before restoring which has a 750MB mysql database in it which looking at seems to have all the data I am missing in it. How on earth do I restore that? :thinking:

Hi @DEGA0221!

That will help with both backups and restores. But in this case it sounds like you don’t have Arc’s optional iCloud Backups, only GPX export files? On the Settings tab, do you see it saying at the top that it’s in the process of restoring from backup?

If Arc is currently restoring from its own iCloud backups, then it’ll get through that restore faster in the foreground, but it will still take a long time. If it is restoring though, it’s best to just ignore it and not worry about it, because it’ll take a long time either way, and paying attention to its slow progress is just frustrating :joy:

Unfortunately you can’t yet. The current imports system was built specifically for importing Moves app data - built in a massive rush, when Facebook suddenly shut down the Moves app. So it’s code that I couldn’t easily adapt to importing other file formats.

As part of the new backups system I’m also building a generalised imports system that will be able to import from a much larger range of file formats (including GPX). So once that’s done you’ll be able to import those GPX files to fill in gaps.

Hmm. That’s a good thing to have! But unfortunately there’s no easy (or even difficult) way to use that to get the data back into Arc. But at least having that copy means that you haven’t fully lost that data!

Off the top of my head, I can imagine it being possible (albeit fiddly and difficult) to use those SQLite files in a custom build of Arc Mini from Github. (Arc Mini shares all of its underlying recording, processing, and database code with Arc App). But that would require building from Xcode, and possibly doing a fair bit of fiddling and trial and error. Not trivial. And at the end of it you’d still only have a separate database that the main Arc App couldn’t see (due to the apps being in separate secure containers / App Groups on the phone). Hmm…

Well it seems the timeline database exported to JSON isn’t far off the format that you export manually.

Some tweaking and it would match, therefore as long as your importer can deal with exported Arc data then it should be able to import all this too?

At the end of the day, the data is in the right format, it just needs to be merged with the “new” database currently on my phone…

I’ve started fiddling with Arc Mini, but a little too far outside of my coding abilities!

Embarrassingly, Arc can’t yet import its own JSON format! But that format is the foundation of the new backup system, so if you can get the data into that format, it’ll be easily importable with the new restore / import system once it’s ready :grinning_face_with_smiling_eyes::tada:

Exactly. My only concern with the raw database data is that the SQL schema has gradually changed over time. Though almost all changes are of additional fields and indexes, while existing fields remain unchanged. So theoretically SQL data from an older copy of the db should be mergeable into an up to date schema db. But it only takes one little catch to make a simple fix into a nasty time consuming one, which is why I have reservations about working directly with the SQL data. Still, it’s an option. And given that neither Arc nor Arc Mini can import GPX or Arc JSON yet (much to my shame), it’s one of the more viable options at this stage.

Aside: The current Arc Mini code can actually import Arc JSON, given a bit of arm twisting. The export/import of that format is already fairly solid and well tested, it’s just the surrounding file importing infrastructure and UI that’s still missing, ie that last 20% that takes 80% of the time :smirk:

So a few months down the line I notice you’ve made some changes.

Are we any closer to being able to recover this data into Arc or is it destined to be a SQL database forevermore?

1 Like

It’s close! I haven’t made the manual file importer be able to understand single file JSON exports yet, but the new backup/restore system uses the same JSON, just split into separate files (ie TimelineItem files, LocomotionSample files, Place files, etc, instead of all of them in one timeline file). So it’ll just be some minor fiddling to get that last step done.

I’m hoping to get some time for that soon. Though I’m very far behind on a whole lot of stuff at the moment (lockdowns suck all my productivity away :persevere:), so I’m not sure which things I’ll get to first at the moment.

If you don’t see it arrive in an update soon, definitely hassle me about it!

What’s the situation at the moment, 8 months later :slight_smile:

There’s now a way to import Arc JSON files, thanks to the help of @AvianLyric!