Backup and Restore in Firebird [and Interbase] (but you knew that already)

Always nifty to have it all in one spot 🙂 Of course, this works for Interbase, too… all in the documentation.

Where dbserver = 127.0.0.1 (if it’s on localhost) and /databases/dbfile.fdb could be x:\DIR\FILE.[gdb|fdb] etc…

A “normal” Backup

gbak -v -t -user SYSDBA -password masterkey dbserver:/databases/dbfile.fdb c:\backups\dbfile.fbk

Backup with output to a logfile

del c:\backups\dbfile.log
gbak -v -t -user SYSDBA -password masterkey -y c:\backups\dbfile.log dbserver:/databases/dbfile.fdb c:\backups\dbfile.fbk

A “normal” Restore

gbak -c -v -user SYSDBA -password masterkey c:\backups\dbfile.fbk dbserver:/databases/dbfile2.fdb

Restore to an already existing database (Firebird 1.0, 1.5)

gbak -c -r -v -user SYSDBA -password masterkey c:\backups\dbfile.fbk dbserver:/databases/dbfile.fdb

Restore to an already existing database (Firebird 2.0)

gbak -r o -v -user SYSDBA -password masterkey c:\backups\dbfile.fbk dbserver:/databases/dbfile.fdb

Create a read-only database

gbak -c -v -mode read_only -use_all_space -user SYSDBA -password masterkey c:\backups\dbfile.fbk c:\files\dbfiledb.fdb

One comment on “Backup and Restore in Firebird [and Interbase] (but you knew that already)

Leave a Reply

Your email address will not be published. Required fields are marked *