Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Backup and Restore

Author  Topic 

pras2007
Posting Yak Master

216 Posts

Posted - 2009-04-03 : 18:27:18
Hello All,

I want to copy a database from one server to a different server by the way of backup and restore. Below are questions that I have:

How can I copy a database from one server and restore it in another server that already has an old copy of that database?

What would be the best way to move the backup database from the first server to the second server?

Once that backup file is in the second server, then I can be able to restore that database?

Please advice. Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-04-03 : 19:36:46
If you want to overwrite the existing data, just use WITH REPLACE of the RESTORE DATABASE command. If you want to instead create a new database using a different name, then just specify that in the RESTORE DATABASE command.

Check out my blog article for how I do this: http://weblogs.sqlteam.com/tarad/archive/2009/02/25/How-to-refresh-a-SQL-Server-database-automatically.aspx

You do not need to copy the backup file to restore it. You could use a full UNC path instead in the RESTORE DATABASE command.

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

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

pras2007
Posting Yak Master

216 Posts

Posted - 2009-04-06 : 00:51:03
Thanks for the response.

I Tried to restore the database, but is seems that I grab the wrong .bak file, now the database is stuck in restoring mode. Does anyone know how to stop the restore? Please help
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-04-06 : 12:33:55
You probably didn't select the correct option in the restore. It just means it's in recovery mode and waiting for you to apply more files. Are you using the GUI or the RESTORE comamnd?

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

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -