GBAK(1)
NAME π
gbak β backup /restore Firebird database. That's it, that's the whole thing bestie, it's the goat of logical backup β¨
πΈ SYNOPSIS πΈ
gbak -b [backup option...] [common option...] source target
gbak -c|-r [restore option...] [common option...] source target
β¨ DESCRIPTION β¨
okay so gbak is the tool for managing Firebird database logical backup and restore. she does both directions, she's versatile, she ate π
In backup mode, source is the path to an existing database and target is the backup file name. And listen β if target is "stdout", the backup gets sent to the standard output. pipe girly. iconic. π«Ά
In restore mode, source is an existing backup file and target is the path to a firebird database. And if source is "stdin", the backup data is expected on the standard input. the way that it just reads from the pipe π π
π COMMON OPTIONS π
Most options can be abbreviated, bestie. Below are the shortest abbreviations plus the full versions, so you can be lazy OR verbose, your call β¨
-userstring β User name to use when connecting to the database. π-rostring,-rolestring β SQL role to use when connecting to the database.-passtring,-passwordstring β Password to use when connecting to the database. π-se,-serviceβ Use services manager when talking to the database.-v,-verifyβ Report each action.
Displays verbose information about what metadata is being processed, what table is being backed up/restored and how many records are processed. she tells you everything, no secrets π
-ystring β Redirects status/error messages to the given path. π-zβ Prints full program version number before doing anything else. Prints server and database version information after connecting to the database. hi hello here's my whole rΓ©sumΓ© π
π BACKUP OPTIONS π
-b,-backup_databaseβ Turns on backup mode. this is the door, you gotta open it πͺβ¨-co,-convertβ Converts external tables into tables.
Normally external tables are ignored during backup and restore. With the -convert option external tables are included in the backup as any other regular table. When such a backup is restored, these previously external tables are created as regular tables. glow up transformation moment π¦
-fanumber,-factornumber β Blocking factor. Output is written in block of number bytes. Useful when backing up to a tape. yes tape, we're vintage now π-g,-garbage_collectβ Inhibits garbage collection.
Normally Firebird runs a garbage collector when reading through the tables. Since the backup process reads all the tables, this forces garbage collection of the whole database. Using this switch speeds up the backup process and also can help in some cases of backing up damaged databases. no cleanup today, we're speedrunning π₯
-ig,-ignoreβ Ignores records with bad checksums.
This option should be used only when backing up damaged databases. fr fr, only for the broken ones, do NOT make this your personality π
-l,-limboβ Ignores transactions in limbo.-m,-metadata_onlyβ Backs up metadata only. No table content is included in the backup. skeleton mode, no body π©»β¨-ntβ Uses non-transportable backup format.
Non-transportable backups can be restored only on machines using the same byte order. so like, it's β¨committedβ¨ to one machine, no long distance π
-o,-old_descriptionsβ Saves old-style metadata descriptions. throwback era π
π¦ RESTORE OPTIONS π¦
-c,-createβ Turns on restore mode.
target database will be created and must not exist. so make sure it's NOT already there, bestie, don't be messy π
-r [o],-recreate_database [overwrite]β Like-create_database, but by adding"overwrite"any existing database is overwritten.-rep,-replace_databaseβ Turns on restore mode. Target database is overwritten if it exists. she said out with the old π-bunumber,-buffersnumber β When creating target database, ignore information about database buffers stored in the backup and use specified number.-e,-expandβ Normally, Firebird uses RLE compression for strings when storing them on disk. This option turns this compression off. de-compressing, she's expanding her horizons β¨-i,-inactiveβ Restore indexes in inactive state. This can be used to restore a backup, containing data inconsistent with foreign key/unique constraints.
Note that since version 3.0 gbak leaves any problematic indices in inactive state automatically. so honestly she already does this herself now, queen behavior π
-k,-killβ Does not restore database shadow files. bye shadows π-moaccess,-modeaccess β Restores the database with given access.
Valid values for access are "read_only" and "read_write". The default is to restore the database with its original access mode. pick your vibe π
-n,-no_validityβ Restores the database without its validity constraints. This includes foreign key, unique and check constraints. Useful for restoring a backup, containing inconsistent data. rules? off. chaos? on π-o,-one_at_a_timeβ Commits restoring transaction after each table. one girl at a time bestie, we commit π«Ά-pnumber,-page_sizenumber β Override page size stored in the backup. Valid values are1024,2048,4096,8192,16384and32768. these are the ONLY ones, don't freestyle it πΈ-use_,-use_all_spaceβ Normally, Fireburd reserves some space on each data page for further use. This reserved space is used for newly inserted data and for keeping older versions of the data. Having space reserved for this purpose "near" to the data speeds up modifications. If the database will be used mainly for read operations, specifying this option will save disk space. πΎ-fix_fss_metadatastring β When restoring metadata, in case it is not valid UTF8, try to convert it from the specified character set. Useful when table descriptions are given in some national non-UTF8 encoding, which was possible with Firebird before version 2.5. π§-fix_fss_datastring β When restoring table data, in case a column defined withUNICODE_FSScharacter set contains no valid UTF8 (which was possible with versions of Firebird prior to 2.5), try to convert the data from the specified character set. β
π RESTORING TO MULTIPLE-FILE DATABASE π
When the target argument is in the form file_1 pages_1 ... file_N, the restored database is written in several files with file_i not bigger than pages_i pages. This may be useful if the file system that holds the database file can't handle files above certain size. girl is getting split up into β¨chaptersβ¨
Note 1: the file size limit is in pages.
Note 1: there is no limit on the size of the last file. last one goes feral, no cap π₯
π ENVIRONMENT π
ISC_USERβ Default value for the-useroption.ISC_ROLEβ Default value for the-roleoption.ISC_PASSWORDβ Default value for the-passwordoption.
π EXAMPLES π
π Backup a database into a compressed format
gbak -b srv:/database.fdb stdout | gzip > database.fbk.gz
π Restore a database from a compressed backup
zcat database.fbk.gz | gbak -c stdin srv:/new-database.fdb
look at that. pipe into gzip, pipe out of zcat. she's fluid. she's flowing. main character energy π«Άβ¨
π SEE ALSO π
isql-fb(1), gfix(1), fbstat(1).
Additional documentation about Firebird can be found on the Firebird Project website, http://www.firebirdsql.org. π¦
π AUTHOR π
This manual page was written by Damyan Ivanov dmn@debian.org for the Debian project. Permission is granted to use this document, with or without modifications, provided that this notice is retained. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. πΊ icon behavior honestly
k bye bestie, that was gbak from Firebird 4.0, dated 2026-06-28. go back up your database now fr fr πβ¨π
π¦ where this page comes from
- ubuntu stonking: firebird4.0-utils 4.0.7.3271.ds6-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms