Share via


Move site collections to a new database (split a content database) (Windows SharePoint Services 3.0)

Applies To: Windows SharePoint Services 3.0

 

Topic Last Modified: 2009-04-17

Some site collections within a database that hosts multiple site collections are growing faster than expected, and you expect the database to approach its size limit quickly. You can split the database to move the growing site collections to another database or to another server.

Split a content database

You can use this procedure to split a content database that is associated with your site collections. The process of moving a site collection between databases consists of exporting the site collection URL data to a file and then importing the data to a new database.

Important

We recommend that you install the April Cumulative Update before you split content databases. This update fixes known issues with the Stsadm mergecontentdbs operation. For more information, see Deploy software updates for Windows SharePoint Services 3.0.
Before you use the Stsadm mergecontentdbs operation, make sure that there is free space available on the hard disk that is equal to at least three times the size of the source site collection. To determine the size of the site collection, refer to the StorageUsedMB attribute of the Stsadm enumsites operation in step 2 of the following procedure.
To complete the following procedure, you must be a member of both the Farm Administrators group and the Administrators group on the local computer. You must have Full Control permission for any site collection that needs to be moved. The account that you use to perform this procedure must be a member of the db_ownerfixed database role in SQL Server.

Split a content database (move a site collection to a different database)

  1. At a command prompt on the drive where SharePoint Products and Technologies is installed, change to the following directory:

    %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin

  2. Type the following command, and then press ENTER:
    Stsadm -o enumsites -url <URL> > <path/file name>.xml

    where url is the address of the Web application that contains the site collection that you want to move, and path/file name is the name of the XML file that you want to create with the site collection data.

    For more information, see Enumsites: Stsadm operation (Windows SharePoint Services).

    The previous step creates an XML file that contains all of the site collection URLs in the current database.

  3. Open the XML file that you created in a text editing application. If there are any URLs for site collections that you do not want to move, be sure to delete them from the file. The only URLs that should remain in the XML file should be for the site collections that you want to move.

    Note

    There is no need to change the site count or any of the other site collection information in the file. Only the URLs are relevant to this procedure.

  4. Type the following command, and then press ENTER:
    Stsadm -o mergecontentdbs -url <URL> -sourcedatabasename <database name> -destinationdatabasename <database name> -operation 3 -filename <file name>

    where url is the address of the Web application that contains the site collection that you want; sourcedatabasename is the name of the database that you want to move the site collection from; destinationdatabasename is the name of the database that you want to move the site collection to; operation 3 is the “Read from file” operation; and file name is the name of the file that contains the site collection URLs that you want to move.

    For more information, see Mergecontentdbs: Stsadm operation (Windows SharePoint Services).

  5. Restart IIS by typing the following command, and then pressing ENTER:
    iisreset /noforce

See Also

Concepts

Add, split, and merge content databases (Windows SharePoint Services 3.0)
Add a content database (Windows SharePoint Services 3.0)
Merge content databases (Windows SharePoint Services 3.0)