SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Restore database to different database?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

thecoffeeguy
Yak Posting Veteran

USA
98 Posts

Posted - 10/08/2008 :  14:09:27  Show Profile  Reply with Quote
hello everyone.
Have a question on how to restore a database to a different database.

I have a full backup of a test database in my environment.
I want to take that backup and basically, restore it to a different database instance on the same server? Make sense?

So if the first DB is called "Mickey", I want to create a new database instance on the same server as "Mickey" and call that new instance "Daffy".

Then, i want to take the full backup of "Mickey" and restore it into "Daffy".

Is it possible to do this?
Thanks.

Jason

tkizer
Almighty SQL Goddess

USA
35940 Posts

Posted - 10/08/2008 :  14:21:22  Show Profile  Visit tkizer's Homepage  Reply with Quote
RESTORE DATABASE Daffy
FROM DISK = 'E:\Backup\Mickey.bak'
WITH REPLACE, MOVE 'Mickey_Data' TO 'E:\Data\Daffy_Data.mdf', MOVE 'Mickey_Log' TO 'E:\Data\Daffy_Log.ldf'

You'll need to make the appropriate changes to the above code. You can also do this through the restore GUI by modifying the option page.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sodeep
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 10/08/2008 :  14:23:01  Show Profile  Reply with Quote
What is your requirement? Didn't get what you meant?
Go to Top of Page

thecoffeeguy
Yak Posting Veteran

USA
98 Posts

Posted - 10/08/2008 :  14:23:21  Show Profile  Reply with Quote
quote:
Originally posted by tkizer

RESTORE DATABASE Daffy
FROM DISK = 'E:\Backup\Mickey.bak'
WITH REPLACE, MOVE 'Mickey_Data' TO 'E:\Data\Daffy_Data.mdf', MOVE 'Mickey_Log' TO 'E:\Data\Daffy_Log.ldf'

You'll need to make the appropriate changes to the above code. You can also do this through the restore GUI by modifying the option page.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog




Thanks Tara. I will give that a shot and report my results.
Cheers,

Jason
Go to Top of Page

systemaddictshock
Starting Member

USA
1 Posts

Posted - 02/04/2010 :  16:49:49  Show Profile  Reply with Quote
The GUI method worked for me! It was pretty easy too!
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 02/05/2010 :  03:50:59  Show Profile  Reply with Quote
I also like to change the (internal) logical names of the database - otherwise they keep the name of the original

ALTER DATABASE MyDatabaseName 
		MODIFY FILE (NAME = 'OrigDatabase_Data', NEWNAME = 'MyDatabaseName_data')
GO
ALTER DATABASE MyDatabaseName 
		MODIFY FILE (NAME = 'OrigDatabase_Log', NEWNAME = 'MyDatabaseName_log')
GO

(but you will have to find out what the original names were)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000