SQL Server – How to Change Backup Destination While Retaining Location Knowledge

backupsql server

I currently have a number of SQL Server (2008 R2) databases that are receiving tlog and differential backups.

The backups are currently being stored on a NAS that is going to be repurposed. I need to start sending the backups to a new NAS that has a different path from the current NAS.

What I would like to do is forklift all of the current files from the current NAS to the new NAS, and reconfigure the current backup jobs to begin saving to the new NAS.

I know this won't break the restore chain, but I'm concerned this move will break SQL Server's awareness of where to find backup files in the backup chain. (It will try to find old backup files in in the old NAS location, not the new NAS location.)

Can this be accomplished by updating the records in the backupmediafamily table alone, or is there more to it than this?

Best Answer

If your retention period for backups is 1 month or something relatively limited, I would suggest the following approach.

  1. Retain the OLD NAS until the expiry of your retention period for those backups.
  2. Create your directory structure on the NEW NAS and redirect your backups there.
  3. Once your retention period on the OLD NAS expires, then drop use of the OLD NAS.

As you delete old backups the SQL Server will still have the OLD NAS path on the backups that went there. So it will progressively delete those files without any further action from you.

I generally recommend against updating system tables.

When we have to move files, we just move them and cope with an extra script to handle the moved files until they are purged. If you have a week or two on NEW NAS the likelihood of needing the older backups is small.