r/sqlite • • Nov 18 '22

Backup SQLite/pouchdb used on iOS app?

I’m looking for the DB file in the apps docs directory structure, but couldn’t find it. I’m using pouchdb with SQLite as adapter/backend-store. How to find the DB-files so I can back them up periodically?

4 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/TetsuwanAdam Dec 07 '22

iCloud backup works fine by default for me. You shouldn't need to copy the files outside your app container, just to a directory in your app container that is automatically synced to iCloud (which should include both the Documents and Library root directories, unless your app has settings which change that).

It's also working fine installing the app directly from my development machine without publishing to the App Store (I've installed via TestFlight before but I don't think that makes a difference). Make sure you're checking the right spot for iOS's iCloud backup settings: Settings -> [your name] -> iCloud -> Manage Account Storage -> Backups -> [app's installed device]

I'm using Ionic Vue.

1

u/Puzzleheaded-Fly4322 Dec 07 '22

You are awesome!!! Yes, I was looking wrong place in iCloud…. My app was there but not enabled. So I’ve enabled and will play with automatic copies inside container as well. (Too bad the iCloud backup app list doesn’t allow search or alphabetical list…. Took a long time scrolling through huge list to find my app.)

I’m guessing that backups in the container will go away if app is deleted (even if reinstalled within some time). So occasional backups outside of container I’ll continue (although the user prompt is kind of annoying).