Link to home
Start Free TrialLog in
Avatar of cmdolcet
cmdolcetFlag for United States of America

asked on

How to backup two databases and over write another

I have my production Database that I would like to backup and then restore the data to a "sandbox" database. The problem is that I the production database is not the same name as the sandbox database.

How would I solve this issue and be able to backup the production data and rename it to the sandbox database.

Thanks in advance.
Avatar of Patrick Bogers
Patrick Bogers
Flag of Netherlands image

Hi

Just restore the sandbox db and in the process point to the backup files from the production one.

Cheers
ASKER CERTIFIED SOLUTION
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

but you need to make sure that you do not use the database name itself inside of any of the objects (SPs, UDFs, Views). So if there is something like "SELECT ... FROM ProductionDatabase.dbo.TableName" then of course you need to remove "Productiondatabase." from all these code lines as it is normally never needed to explicitly add the database name. This should be removed permanently, not only for the sandbox.

I recommend to use a tool like Redgate Search (free to download and install) which is able to search through all existing objects.

Cheers,

Christian