Move site collections to a new database (split a content database) (Office SharePoint Server 2007)
Updated: May 14, 2009
Applies To: Office SharePoint Server 2007
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. When you split a content database, you are moving a site collection to a different database.
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 Office SharePoint Server 2007.
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_owner fixed database role in SQL Server.
Split a content database
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
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 (Office SharePoint Server).
The previous step creates an XML file that contains all of the site collection URLs in the current database.
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.
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.
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 (Office SharePoint Server).
Restart IIS by typing the following command, and then pressing ENTER:iisreset /noforce.