On 3 Jul 2015, at 1:39pm, Rob Willett <rob.sqlite at robertwillett.com> wrote:

> is Vacuum the same as doing the .dump and restore or is it different? We like 
> the .dump as it gives us a nice easy to use backup :)

It's the same thing (more or less).  Mikael remembered it and I'd forgotten it 
(thanks).  But if your data are important then there are reasons to do both.  
Do a .dump first, then VACUUM.  The VACUUM is to speed things up and the .dump 
is for archiving.  Not that I've ever seen VACUUM fail and lose both the 
'before' and 'after' versions of a table, even when running out of disk space.

I like using '.dump' too because I can read the results with human eyes and I 
don't need to have a working SQLite platform to use the resulting file.  For 
all I know the problem that caused me to need the backup was so serious 
(duplicate UNIQUE keys ?) that I will have to read the results into a text 
processor and modify them, which is something you cannot do with a SQLite 
database file.

The SQL command files which result from .dump compress well into .zip or .7z 
files, of course.  Good for keeping many generations of archive around.

Simon.

Reply via email to