Beware of Open Rooms

SQLite database files are just ordinary files. There is nothing particularly magic about actually making the backup: just make a copy of the file.

However, as with most files, it is important that nothing be trying to write to that file while we are making a copy. Otherwise, we may have a mix of old and new data, and most likely that will result in a corrupted and unusable database.

So, we need to take steps to ensure that nothing is trying to use the database while the backup is going on (or while we are restoring a backup). We will explore specific ways of doing that here in this chapter.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.