You are not logged in.
Pages: 1
I'm testing methods for backup a SQLite database. More precisely BackupGZ.
This is my code:
var
Props:TSQLDBConnectionProperties;
begin
Model := CreateBigSampleModel;
Props := TSQLDBSQLite3ConnectionProperties.Create('Teste.db3' , '', '', '');
VirtualTableExternalRegister(Model,TSQLBigSampleData,Props, 'SampleRecord');
Database := TSQLRestClientDB.Create(Model,nil,'MainDb.db3',TSQLRestServerDB,false,'');
TSQLRestClientDB(Database).Server.DB.Synchronous := smOff;
TSQLRestClientDB(Database).Server.DB.LockingMode := lmExclusive;
TSQLRestClientDB(Database).Server.CreateMissingTables(0);
TSQLRestClientDB(Database).Server.BackupGZ('Backup.gz');
end;
Apparently he is backing up MainDB.Db3 and not the actual base Teste.db3.
If I use this:
Database := TSQLRestClientDB.Create(Model,nil,':memory:',TSQLRestServerDB,false,'');
An error occurs when backing up.
What is the correct way to backup a External SQLite database?
Offline
Apparently he is backing up MainDB.Db3 and not the actual base Teste.db3.
Yes, this is by design, since you are working at the TSQLRestClientDB(Database).Server.DB level, i.e. for MainDB.db3.
For the external table, you can use the MainConnection.
Online
Thanks
Only found this option. Is that correct?
TSQLDBSQLite3Connection(Props.MainConnection).DB.Backup('teste.bkp');
Is there any way to restore this backup in the framework?
It has some class that provides a method similar to BackupGz with compression?
Last edited by Roberto Schneiders (2013-07-26 16:48:48)
Offline
I started to have problems with this backup method. Are experiencing the same error reported in these other posts.
http://synopse.info/forum/viewtopic.php?id=881
http://synopse.info/forum/viewtopic.php?id=643
http://synopse.info/forum/viewtopic.php?id=662
"cannot VACUUM - SQL statements in progress"
We do not perform any SQL command before running the backup. Simply open the program and ran the backup.
What is the correct way to back up an external database?
Offline
Pages: 1