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
 General SQL Server Forums
 New to SQL Server Administration
 what is the best way to move a database

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2010-11-30 : 13:31:30
what is the best way to move a database from one server to another with the least downtime?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-30 : 13:39:31
Backup/restore

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

Subscribe to my blog
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-11-30 : 14:01:05
Full backup
Restore to new location WITH NORECOVERY
if that has taken a while then repeate using a DIFFERENTIAL backup

Make TLog backup

Restore all TLog backups since Full (or Diff) backup to new location WITH NORECOVERY

*** START OF DOWNTIME ***

Throw users off

Set Source database to SINGLE USER + READ ONLY
Make final TLog backup
Restore Final TLog backup (watch out for and any other Tlog backup that may have been generated by Maintenance Task) to new location WITH NORECOVERY

RESTORE NewDatabase WITH RECOVERY - to set it to become active

Change the NewDatbase to be MULTI_USER and READ-WRITE

NOTE: You may have to change the Connection String for the application, or swap over the IP address of the new server so it replaces the old one, otherwise users won't connect to the new server!

*** END OF DOWNTIME ***

The various steps need scripting so that they can be run easily without having to click on the GUI tools etc.! and a dress rehearsal needs to have been performed to make sure the processes will run smoothly "on the day"

When we do this we aim to have less than 2 minutes down time, more typically on our 24/7 systems the downtime is so short that the users barely notice - we give them a Holding Page for the minute or so with instructions to wait for their session to resume. The holding page does a Meta Refresh every 10 seconds, and will get back in when the site is available again

If you are also upgrading to a new version of SQL then there are other steps to consider.

Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2010-11-30 : 14:16:08
what's the best way to do a clean complete full backup?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-30 : 14:16:56
BACKUP DATABASE command...

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -