The IBExpert Services menu item Backup Database allows you to create a backup or copy of the database, saving it to file. This database copy may be kept simply for security reasons, or restored for the reasons detailed in Why is a database backup and restore important?
This menu item is the management window for the Services API. Here you can specify everything that you can also do on the command line using GBAK.
A database backup may be performed without having to disconnect the database; users may continue their work as Firebird uses its multi-generational architecture to take a snapshot of the database at a moment in time the backup is requested. All information generated by committed transactions and present at this moment, is backed up.
First select the database to be backed up from the drop-down list of registered databases. Then select either an existing backup filename, or add a new backup file using the Insert File icon (or [Ins] key).
The […] button to the right of this row allows you to find an existing file or specify the drive, path and backup filename for a new file. Please note that IBExpert will only create a filename on the server, and not locally (as with GBAK), because IBExpert uses the Services API. A local backup can only be performed using GBAK. The suffixes .GBK and .FBK are traditionally respectively used for InterBase® and Firebird backup files. A file size only needs to be specified when working with secondary files. All files in a multi-file database are backed up (i.e. both secondary files and shadow files). Firebird understands the links that exist with secondary database files and with shadows. Whereas the operating system backup works on a file-by-file basis, Firebird always backs up all files in a database.
Select the option On Screen or Into File for the log (not forgetting to select or specify a filename for this protocol). This option is useful if the backup is failing and the reason needs to be analyzed.
The following Firebird 3 and 4 options are supported:
Show runtime statistics: this is equal to the -STATISTICS gbak switch and should contain any combination of T, D, R, W chars as described in the Firebird documentation (https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/bk02ch11s03.html). Arguments for gbak STATISTICS output:
Item | Argument | Data Reported |
---|---|---|
Total time | T | Time elapsed since the gbak process started, in seconds and milliseconds. |
Time delta | D | Time elapsed since the previous line of output, in seconds and milliseconds. |
Page reads | R | Number of page reads since the previous line of output, integer. |
Page writes | W | Number of page writes since the previous line of output, integer. |
Ignore the data from specific tables: this is equal to -skip_d(ata) gbak switch and may contain any regular expression as described in https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/bk02ch11s03.html. For example: (sales|customer)
If the protocol option On Screen was selected, the backup is logged on the Output page.
Using the IBExpert menu item Database / Database Registration Info, default backup filenames, paths and drives may be specified if wished, along with default backup and restore options. This information may be specified when initially registering a database in IBExpert (see Register Database) or at a later date (see Database Registration Info).
In normal circumstances, the backup should run smoothly without any of the above options having to be checked. If however, corrupt or damaged data is suspected or problems have been encountered, alter the Format to Non-Transportable and check the options Ignore Check Sum and Ignore Transactions in Limbo. Although this will not provide the usual database compression, it does provide a complete copy of the database, which is important before starting to repair it.
It is also possible to validate the database using Services / Database Validation or GFIX, before retrying.
IBExpert automatically generates an IBEBlock, based on the options selected. Further information regarding ibec_BackupDatabase can be found here: ibec_BackupDatabase. A sample IBEBlock for an automated daily backup can be referred to here: Performing a daily backup of the IBExpert User Database.
To automate the backup/restore process for your databases, you can also use the HK-Software Service Center's IBExpertBackupRestore server tool. IBExpertBackupRestore is a comprehensive utility, providing automatic backup and restore facilities for Firebird databases with backup file compression even an option to automatically mail backup/restore log files.
See also:
Performing regular backups protects from hardware failures and data corruption, which cannot be fixed by the Firebird maintenance tools. It is important to use the Firebird backup and restore facilities even though most networks include a facility for data backup and restore across the network, because:
It is therefore recommended to not only backup but also restore the database regularly (e.g. once a month).