[EMAIL PROTECTED] wrote:

You should either have your backup application open the database and do a
BEGIN EXCLUSIVE; statement to ensure that no other processes can write to it
while you're backing it up, or if you don't want to do that, you can use the
command line shell and do:

  sqlite3 .dump database.db > database.sql

and then back up database.sql.  In this latter case, the shell ensures that
the database is unchanged during the entire dump.  To restore, you do
something like this on Windows (I'm not a Windows expert so the command may
need some fixing):

  del database.db
  type database.sql | sqlite3 database.db


Derrell,

I believe that should be:

 sqlite3 database.db .dump > database.sql

 sqlite3 database.db < database.sql

But I also wanted to point out that this does not create an exact copy of your database. In particular it does not include the pragams that may have been set in the original database. Settings like default_page_size and auto_vacuum are not dumped.

To create a complete backup you need to use your first approach to create a utility does a normal file copy in code inside a transaction (which prevents other processes from doing any writes).

Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to