patternsqlMinor
Is it possible to change the family_guid in MSSQL?
Viewed 0 times
family_guidthemssqlpossiblechange
Problem
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.
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.
Solution
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:
Quite a process for what should be a simple task!
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:
- Create a .bacpac (contains both data & schema) of the original DB.
- Import that .bacpac into a staging database (could be LocalDB, or another instance somewhere, or even the same instance as the original DB).
- Create a traditional backup (.bak) of the staging DB.
- Upload the backup to S3.
- Run the msdb.dbo.rds_restore_database command on the S3 backup file.
Quite a process for what should be a simple task!
Context
StackExchange Database Administrators Q#147801, answer score: 7
Revisions (0)
No revisions yet.