Move a database from 1 SharePoint Services 3.0 Server to another

ARTICLE

How to move an existing database from 1 Windows SharePoint Services 3.0 server to another Windows SharePoint Services 3.0 server

STEPS

  1. Make a backup of existing (origin) Sharepoint Content database using SQL Server Management Studio.
  2. Restore this backup to the SQL Server on the new (destination) server.
  3. Create a new web application in Sharepoint 3.0 Central Administration on the new (destination) server.
  4. Use Sharepoint 3.0 Central Administration to delete the content database for the newly created web application above.
  5. Manually attach the (origin) Sharepoint Content database to this new web application using the stsadmin.exe command-line tool.

Step 1 (Make a backup of existing (origin) Sharepoint Content database using SQL Server Management Studio)

  1. Open SQL Server Management Studio and connect to your Database Server containing your current (origin) Sharepoint 3.0 Content database.
  2. Expand the Databases group and scroll down to your content database.
  3. Right-Click on the name of the content database and select "Tasks > Back Up".
  4. Save a full backup of your content database.

Step 2 (Restore this backup to the SQL Server on the new (destination) server)

  1. Open SQL Server Management Studio and connect to your Database Server where you wish to restore your existing Sharepoint 3.0 Content database.
  2. Right-click on the Databases group and select "Restore Database..."
  3. Proceed to restore your origin Content Database.

Step 3 (Create a new web application in Sharepoint 3.0 Central Administration on the new (destination) server)

  1. On the new server access the Sharepoint 3.0 Central 3.0 Central Administration (Start > All Programs > Administrative Tools > SharePoint 3.0 Central Administration).
  2. Click "Application Management"
  3. Click "Create or extend Web application".
  4. Click "Create a new Web application".
  5. Choose desired settings on this page (default is fine allowing the system to create a new IIS web site)
    - Select "Restart IIS Automatically"
    - Ensure the Database Server is correct (usually your Server name if a default instance was used when installing SQL Server)
    - Database Name (Ensure the database name is unique in your SQL Server and NOT the name of your origin Content database you just restored)
    - Select Windows SharePoint Services search server (usually your default SQL Server name as above)
  6. Click "OK on this screen to create the new web application, be sure to note the URL of this new application!

Step 4 (Use Sharepoint 3.0 Central Administration to delete the content database for the newly created web application above)

  1. Click "Application Management".
  2. Click "Content databases".
  3. Select your Web Application created in Step 3.
  4. Click on the name of the new Content Database created.
  5. Scroll down and check the box "Remove content database" and click "OK" button.

Step 5 (Manually attach the (origin) Sharepoint Content database to this new web application using the stsadmin.exe command-line tool)

  1. Open a command prompt on the server.
  2. Navigate to the following directory "\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
    i.e. cd \Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
  3. Issue the following command
    stsadm.exe -o addcontentdb -url <new web application url> -databasename <origin content database name>

    Example Command:
    Assumptions
    - New web application url: http://yourserver:1056
    - Origin content database is named: WSS_Origin_Content

    stsadm.exe -o addcontentdb -url http://yourserver:1056 -databasename WSS_Origin_Content

Notes:

1. If you receive an error such as "A SharePoint database named WSS_Origin_Content already exists. You must supply another name for the new database." This indicates you have an existing web application that is using this content database. You will need to go back to step 4 and locate the web application using this content database and remove it.

2. All going well you should receive a response of "Operation completed successfully."

3. If after the move you can no longer search your database via the web client or are receiving a lot of crawl errors in your event log, you may wish to refer to the following article for help