Sql-server – Syncing Database for Server Transition

migrationsql serversql-server-2005sql-server-2008-r2

I'm transitioning from an old web/sql box combined to a much more robust solution on a completely different host (800hosting to RackSpace).

Our application has very high uptime requirements. It runs 24x7x365 and impacts literally thousands of sites, and I want to ensure the minimum possible downtime during the transition. (Don't ask how we're pulling this off with a single box right now.)

My plan for the web server is a little bit of DNS work to point a new subdomain to the new server setup, and forward requests from the existing server. That'll take care of flipping everyone to the new web box fast enough. The problem is the database – how do I keep it in sync until I'm ready to flip the switch on the website (or is it worth the effort vs. just accepting the downtime to stop the app, backup, compress, transfer, and restore?).

A few details. We're running Sql2k5 on the old system, 2k8r2 on the new. The database itself is ~30 gigs for the primary, ~60 gigs for the warehouse. I can live with downtime on the warehouse, but really want to minimize the impact on the main database.

Any suggestions for the best way to migrate the database across from the old setup to the new?

Best Answer

S1 = old server, S2 = new server

  1. Full Backup S1
  2. Restore to S2 and with NOrecovery
  3. Block ALL data changing connections to S1 (e.g. change web connection password)
  4. Diff backup on S1
  5. Restore diff to S2 with recovery - S2 will now be ready
  6. Enable connections to S2 ( don't forget to reset any changed passwords back to the originals)