Ricardo Acras
Ricardo Acras

Reputation: 36244

Is it possible to make Firebird database backup via SQL?

I need my software to make hot backups of a firebird database. Using gbak is the official way of doing that. But using an external tool will force me to get through the hassle of ensuring that the tool is in the system PATH or that I have the actual location of gbak.exe. If possible I want to avoid this.

So, are there any options of doing something like

BACKUP DATABASE TO location_of_backup;

I am using Delphi XE4, Firebird 2.1 and DBExpress, not an option to install third parties here.

Upvotes: 2

Views: 2257

Answers (1)

Hugues Van Landeghem
Hugues Van Landeghem

Reputation: 6808

This is not possible with SQL.

With Delphi XE4 you can use IBExpress (TIBBackup) to make backup easily. You don't need gbak.exe.

FireDac can also make this if you get it (TADIBBackup).

ADIBBackup1.DriverLink := ADPhysIBDriverLink1;

ADIBBackup1.UserName := 'sysdba';
ADIBBackup1.Password := 'masterkey';
ADIBBackup1.Host := 'db_srv_host';
ADIBBackup1.Protocol := ipTCPIP;

ADIBBackup1.Database := 'e:\ib\addemo.fdb';
ADIBBackup1.BackupFiles.Add('e:\ib\addemo.backup');

ADIBBackup1.Backup;

Upvotes: 5

Related Questions