© Kevin Languedoc 2016

Kevin Languedoc, Build iOS Database Apps with Swift and SQLite, 10.1007/978-1-4842-2232-4_11

11. Backing Up SQLite Databases

Kevin Languedoc

(1)Montreal, Canada

  • Copy contents to new database

  • Backing up on-disk databases

  • Backing up in-memory databases

Overview of the SQLite Backup Methods

Prior to the introduction of the Backup API, the only way to perform a backup was to make a copy. While this is still a viable option, it does have its drawbacks, like trying to make a copy while there is a lock on the open database, for instance. Another drawback is if the app stops running before the copy is finished, the app would need to delete the copy and start over. In addition to those two examples, there are numerous ways a copy process ...

Get Build iOS Database Apps with Swift and SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.