Sql-server – Does SQL Server full restore set the differential base

backuprestoresql serversql-server-2008

Differential backups are taken as the difference between the current state, and the last full backup called the "differential base".

Does restoring a full backup reset the differential base? If so, is there a way to avoid that?

The Microsoft docs only say that a backup resets the differential base. My experiments are a little inconclusive, although it seems that restores also reset this value.

I have a list of full backups taken sequentially over time. I'm switching this to a periodic full backup, with interspersed differential backups, eg. one full backup a month, with hourly differentials. However, the existing backup sets are all full backups.

I'm writing a script I want to run on a spare server which will go through the existing sets and sequentially restore them and generate differentials from the backup at the beginning of the month. This won't work if a restore resets the differential base though.

Any pointers or suggestions would be much appreciated. I actually already had something like this working with a binary diff program, but that mysteriously broke this month, so I'm trying to switch to using the built-in differential backups.

Edit: gbn as adequately answered the question of whether the restore resets the differential base, but I'd still like some suggestions on whether it's possible to extract a differential backup if given two full backups.

Best Answer

The differential backup is always associated with the last full backup. It is that simple.

So any differential restore is looking for a certain full restore.

So yes, the base is reset. You can't mix and match.

Personally, I wouldn't have monthly full backups and hourly diffs. The frequencies don't match (example: weekly full, daily diff, hourly log). And I wouldn't use any binary file diff rubbish for my backups because I expect to be able to restore them.