A while ago a customer invested in a SQL-cluster and naturally wanted to move all databases there. There are a number of articles on the net on how to migrate to a new server, some more complicated than others. In my case I had a working SQL 2005 instance which was dedicated to the MOSS installation and wanted to move to a new SQL 2005 cluster. Instead of rebuilding the entire farm like some people suggest i found it easiest to use the “rename server” command in stsadm. Here’s a step by step guide:

  • Close your farm. Stop the IIS on all WFE’s and the indexing service etc.
  • Backup all databases on the current SQL-server.
  • Restore the databases on the new SQL-server.
  • Make sure the configured user account in Sharepoint has the appropriate rights on the new SQL-server.
  • Now all we have to do is rename the old SQL-server on all servers to the name of the new SQL-server in the farm using stsadm:
    stsadm -o renameserver -newservername newsqlserver -oldservername oldsqlserver
    (stsadm is located in: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN)

This is by far the easiest way to replace your SQL-server or move a certain installation to a new SQL-server. Depending on the size of your databases of course it doesn’t take longer than 30 minutes to complete. One important thing to remember is that this only works when the databases are hosted on a separate SQL-server. If you’ve been cheap and installed both SQL-server and MOSS/WSS3.0 on the same machine this won’t work obviously.

Related posts