nbackup and gbak compatibility

86 views
Skip to first unread message

Nick Thorp

unread,
Apr 6, 2021, 8:14:56 AM4/6/21
to firebird-support
Hi,
I read through the documentation but couldn't find the answer to this. Are the two backup programs compatible?
i.e. If I make a backup with nbackup, can I restore it using gbak? And vice versa.
And more importantly, if I make a backup with gbak, can I then make an incremental with nbackup and if so, how would I restore it?

I'm asking because we are using gbak for our nightly backups, and we always run a full backup during new releases too. The backups are slowing down the releases so we'd like to just run an incremental during the release instead, and that means using nbackup. But maybe that means we'd need to ensure the previous night's backup was also done with nbackup?

Regards
Nick

Dimitry Sibiryakov

unread,
Apr 6, 2021, 8:20:16 AM4/6/21
to firebird...@googlegroups.com
06.04.2021 13:21, Nick Thorp wrote:
> I read through the documentation but couldn't find the answer to this. Are the two backup
> programs compatible?

No. gbak performs export of data, nbackup makes a physical copy of database file.

--
WBR, SD.

Mark Rotteveel

unread,
Apr 6, 2021, 8:28:44 AM4/6/21
to firebird...@googlegroups.com
On 2021-04-06 13:21, Nick Thorp wrote:
> I read through the documentation but couldn't find the answer to this.
> Are the two backup programs compatible?
> i.e. If I make a backup with nbackup, can I restore it using gbak? And
> vice versa.

No you cannot restore a gbak backup with nbackup or vice versa. Nbackup
and gbak have entirely different models of backup: gbak makes a logical
backup of the data in the database (that is, database structure and row
data as visible to the backup process), while nbackup backs up the
physical data pages of a database, without regard of their actual
content and meaning or transactional visibility. The advantage of
nbackup is that, given it just copies physical datapages, it can easily
create an incremental backup by just backing up the data pages modified
after the previous backup. This difference is also the reason why these
are separate executables.

> And more importantly, if I make a backup with gbak, can I then make an
> incremental with nbackup and if so, how would I restore it?

Given gbak and nbackup are entirely separate, there is no connection
between the two. Yes, you can create backups with both gbak and nbackup
(using one does not disallow use of the other), but if you're asking if
you can create a backup with gbak and then have an incremental backup
against that backup with nbackup (that is: only backup the changes since
that gbak), then the answer is no. And the reason is precisely because
gbak makes a logical backup and nbackup a physical backup: when you
restore a gbak backup, you get the same data, but the layout and content
of physical data pages can be entirely different from the previous
database; any incremental nbackup of the previous database would be
meaningless against this new database (and attempts to naively merge
such would just result in either logical or physical corruption).

> I'm asking because we are using gbak for our nightly backups, and we
> always run a full backup during new releases too. The backups are
> slowing down the releases so we'd like to just run an incremental
> during the release instead, and that means using nbackup. But maybe
> that means we'd need to ensure the previous night's backup was also
> done with nbackup?

If you want to be able to do an incremental backup, then you have to use
nbackup also for the initial full backup (maybe next to a gbak backup,
or maybe instead of a gbak backup).

Mark

Nick Thorp

unread,
Apr 6, 2021, 3:28:47 PM4/6/21
to firebird-support
Wow, I didn't expect such excellent replies so quickly. Thank you very much to you both! It's crystal clear now and I know what we need to do.
Reply all
Reply to author
Forward
0 new messages