Sql-server – Is it possible to change the family_guid in MSSQL

sql servert-sql

So I have a bit of a problem with some databases I'm trying to migrate to amazon RDS

We have about 20 Databases that are all derivatives of others that all share the same family_guid because they are based on backups of others. The problem is that amazon will not allow you to restore a DB that has the same family_guid of another even if they are two separate databases. This is where my question comes in, Is it possible to change the guid or am I out of luck and will need to do some exports/imports on these databases.

Best Answer

I have encountered the exact same scenario as you - many DBs all based off a template, and all need to go into RDS.

AFAIK there is no way to change the underlying family_guid in a simple command. However, using the .bacpac export/import will assign a new family_guid to the imported DB. Sadly you can't directly import a .bacpac into RDS (the import fails, and you can't delete the database!)

So, as a work around, I ended up with the following process:

  1. Create a .bacpac (contains both data & schema) of the original DB.
  2. Import that .bacpac into a staging database (could be LocalDB, or another instance somewhere, or even the same instance as the original DB).
  3. Create a traditional backup (.bak) of the staging DB.
  4. Upload the backup to S3.
  5. Run the msdb.dbo.rds_restore_database command on the S3 backup file.

Quite a process for what should be a simple task!