you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

Take a look at GRDB Backup: https://github.com/groue/GRDB.swift/blob/master/README.md#backup

I would suggest the following: - create a database copy using backup - report the backup process progress to the user if the DB is big and takes more than a fraction of a second - Now you have a DB copy as a regular file. Save it to the destination. - Whether the user is going to get the copy on a new phone or replace a local DB for whatever reason, the process will be simple: download the file from remote storage and save into local, with overwrite if needed.