LuiLui77
asked on
Restoring a database backup into another database
Hello All,
I have an application pointing into 2 MS SQL 2005 databases, one called PRODUCTION and the other called TEST. I am attempting to replicate all information from the production database to the test database so they both have the exact same data in them.
To accomplish this, I have created a backup of the PRODUCTION database and I am now attempting to restore this backup into the TEST database using the restore utility in Management Studio. After selecting the TEST database --> right click --> Tasks --> Restore and choosing the backup that I made of my production database, in the "Restore the database as" section of the Options screen, it appears that the restore will rename the TEST database to the name of my production database (mdf and ldf files) and I dont want this to happen, I want to maintain the original name of the database since I am sure what could happen with my application if the TEST database is renamed.
What should I do next?
I have an application pointing into 2 MS SQL 2005 databases, one called PRODUCTION and the other called TEST. I am attempting to replicate all information from the production database to the test database so they both have the exact same data in them.
To accomplish this, I have created a backup of the PRODUCTION database and I am now attempting to restore this backup into the TEST database using the restore utility in Management Studio. After selecting the TEST database --> right click --> Tasks --> Restore and choosing the backup that I made of my production database, in the "Restore the database as" section of the Options screen, it appears that the restore will rename the TEST database to the name of my production database (mdf and ldf files) and I dont want this to happen, I want to maintain the original name of the database since I am sure what could happen with my application if the TEST database is renamed.
What should I do next?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When you are choosing restore, have you click on the option to overwrite. Also note that when you click on advanced, you have the option to rename the files. When you select overwrite, it will overwrite the existing MDF and LDF with the data from the restored database.
Hi,
You can also copy the relevant .mdf and .ldf files to the folder like
C:\Program Files\Microsoft SQL Server\MSSQL11.SS2002\MSSQ L\DATA
within the server and further attach the DB to the new server.
You can also copy the relevant .mdf and .ldf files to the folder like
C:\Program Files\Microsoft SQL Server\MSSQL11.SS2002\MSSQ
within the server and further attach the DB to the new server.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Paul, it did work by overwriting and changing the paths to reflect the test Databases.
Thanks Vitor for the clarification.
Thank you all fr you input!
Thanks Vitor for the clarification.
Thank you all fr you input!