Home > SharePoint 2007 > Move all SharePoint databases to a different database server with a Different Name

Move all SharePoint databases to a different database server with a Different Name

This article primarily refers to the TechNet article about moving SharePoint Databases, I have added my own notes all along. Databases are critical for SharePoint farm to run, Moving databases can take down your farm so please have a roll back plan before you start.

Note: This process requires shutting down the SharePoint Services and will make all sites unavailable to users until the process is complete. Hence, downtime should be planned before starting this process

The following databases need to be moved to complete the process

  • Databases for Shared Services Providers (SSPs)
  • Search databases for SSPs
  • Content databases
  • Search database
  • Central Administration content database
  • Configuration database

This is a procedure for moving all the databases in an Office SharePoint Server 2007 farm to a new database server that has a different name. The new database server must use the same version of SQL Server as the old database server.

Important: Visit “Servers in the farm” under operations in central admin and record all server names running Windows SharePoint Services Database Service.

Note: The following are the minimum required to perform this procedure:

  • You must be a member of the Farm Administrators SharePoint group.
  • On the computer that is running the SharePoint Central Administration Web site, you must be a member of the Administrators group
  • On the database server from which the databases are being moved; you must be a member of the Administrators group and should have at least the db_backupoperator fixed database role.
  • On the database server to which the databases are being moved; you must be a member of the Administrators group and you should have at least the db_owner fixed database role.

Note: If you do not have permissions on Database server, please co-ordinate with SQL Server DBA to move the databases to the new server.

Move all databases to a different database server

  1. Prepare the new database server by using the Prepare the database servers procedure.
  2. Record which Web applications are associated with the SSP by performing the following steps:
    1. On the SharePoint Central Administration Web site, on the Application Management page, in the Office SharePoint Server Shared Services section, click Create or configure this farm’s shared services.
    2. Record the associated Web applications that are listed on the Manage This Farm’s Shared Services page.
  3. Record the list of Web Applications, SSP’s and associated Databases by going to the “Perform a Backup” page under operations in Central Admin
  4. Stop the farm by performing the following steps:
    1. On the server that is running the Central Administration Web site, in the Services snap-in, stop the following services:
      • Microsoft Single Sign-On service
      • Office Document Conversions Launcher service
      • Office Document Conversions Load Balancer service
      • Office SharePoint Server Search service
      • Windows SharePoint Services Administration service
      • Windows SharePoint Services Search service
      • Windows SharePoint Services Timer service
      • Windows SharePoint Services Tracing service
      • Windows SharePoint Services VSS Writer service
    2. On the server that is running the Central Administration Web site, at the command prompt, type iisreset /stop.
    3. Repeat step 4 on each server in the farm.

Note: If you do have sufficient privileges on the SQL Server, you can Skip steps 5-7 and let your SQL Server DBA team handle the Database Move. The DBA’s can follow backup and restore method as illustrated in Steps 5-7 or DBA’s can detach the Databases in the old server and attach the databases back on the new server.

5. Back up the databases on the source database server.

  • Start SQL Server Management Studio and connect to the database server.
  • In Object Explorer, expand Databases.
  • Right-click the configuration database (usually named SharePoint_Config), point to Tasks, and then click Back Up.
  • In the Back Up Database dialog box, in the Source area, select the type of backup that you want to perform from the Backup type list. Click Database.
  • In the Backup set area, in the Name text box, type a name or use the default.
  • In the Description text box, type a description of the backup.
  • Specify how long the backup should be kept, or use the default. When the backup set expires, the backup set can be overwritten by any subsequent backups that have the same name. By default, the setting for the backup set is 0 days so that it never expires.
    1. In the Destination section, specify a location to store the backup set, or use the default.
    2. Click OK to back up the database.
    3. Repeat steps c through j for the remaining databases in the farm.

6. In Windows Explorer, locate the database backup (.bak) files that you want to move, and then copy or move them to the destination server.

  • Restore databases on the destination database server.
    1. Start SQL Server Management Studio and connect to the database server.
    2. In Object Explorer, expand Databases.
    3. Right-click the database that you want to restore, point to Tasks, point to Restore, and then click Database.
    4. In the Restore Database dialog box, specify the destination and the source, and then select the backup set or sets that you want to restore.
  • The default values for destination and source typically suit most recovery scenarios.
  • In the Select a page pane, click Options.
  • In the Restore options section, select only Overwrite the existing database. Unless your environment or policies require otherwise, do not select the other options in this section.
  • In the Recovery state section:
    • If you have included all the transaction logs that you must restore, select RESTORE WITH RECOVERY.
    • If you must restore additional transaction logs, select RESTORE WITH NORECOVERY.
    • The third option, RESTORE WITH STANDBY, is not used in this scenario.
  • Click OK to complete the restore operation.
  • Repeat steps c through h for each database that you are restoring.

7. Use SQL Server to copy to the destination server the logons for all service accounts, including SQL Server logins, fixed server roles, fixed database roles, and permissions for the databases.

8. Refer the farm to the new database server.

Note: The renameserver operation does not rename named instances of SQL Server.

For Unnamed/Default Instance:

For unnamed instances of SQL Server, follow the steps below

    • On the disk on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft Shared\Web server extensions\12\Bin.
    • Type the following command, and then press ENTER:

stsadm -o renameserver -oldservername <name of the source database server> -newservername <name of the destination database server>

2. Repeat steps a and b for each of the servers in the farm.

For Named Instance:

Use the following procedure if you are using a named instance of SQL Server:

  1. Start the SQL Server Native Client Network Utility, click start, Run, type “CLICONFG.EXE” and Click OK.
  2. On the General tab, verify that TCP/IP is enabled.
    On the Alias tab, click Add.

The Add Network Library Configuration dialog box appears.

    • In the Server alias box, enter the name of the current instance of SQL Server i.e. “OLDSERVERNAME”.
    • In the Network libraries area, click TCP/IP.
    • In the Connection parameters area, in the Server name box, enter the new server name and instance to associate with the alias, i.e. “NEWSERVERNAME\SERVERINSTANCE “
    • Uncheck the dynamically determine port and enter the port  number as 2433.

Note: By default named instances uses port 2433, please check with the SQL Team.

************************************************************************

Important Note: Create Alias for the all the server names recorded at the beginning which runs Windows SharePoint Services Database Services

***********************************************************************

2. Repeat steps on all servers in the farm that connect to SQL Server.

9. Start the new farm by performing the following steps:

  1. In the Services snap-in, start the following services:
    • Microsoft Single Sign-On service
    • Office Document Conversions Launcher service (optional)
    • Office Document Conversions Load Balancer service (optional)
    • Office SharePoint Server Search service
    • Windows SharePoint Services Administration service
    • Windows SharePoint Services Search service
    • Windows SharePoint Services Timer service
    • Windows SharePoint Services Tracing service
    • Windows SharePoint Services VSS Writer service (optional)
  2. At the command prompt, type iisreset /start.
  3. Repeat steps on each server in the farm.

10. Test the process has been completed successfully

  • By Opening Central Admin Site
  • By Opening the Individuals SSP Admin Site
  • By Opening Individual Web Applications
  • By Opening Individual Site Collections which is not mandatory but would be a good test.
Advertisements
  1. joby
    October 24, 2010 at 3:28 am

    We have moved the all content databases from SQL 2005 to SQL 2008, we used stsadm -o addcontentdb command for this. We could successfully restore all site collection content databases. Then we detached the content DB for the central admin and tried to attach it to the new database server. However while, trying to attach it using the same method as with the other content databases, this throws an error – access denied. I have logged on to the server as the administrator.

    Can you please let me know what could be wrong? any help would be highly appreciated. Thanks in advance.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: