Home > SharePoint 2010, SharePoint Administration > Moving SharePoint 2010 Site Collections To New Content Databases using PowerShell

Moving SharePoint 2010 Site Collections To New Content Databases using PowerShell

So recently i’ve been preparing for a data migration between SharePoint 2007 and SharePoint 2010 farms.  In preperation for the migration I had to create seperate Site Collections with their own Content DBs.  Thats simple enough!  However I forgot to create the content dbs prior to building the new Site Collections…opps…so the Site Collections are now sitting in the main SharePoint content db.  Ok time to move these.

To move Site Collections into new Content DBs follow these simple steps.

First create the new Content DBs in Central Administration

1.  Browse to Central Administration -> Application Management -> Manage Content Databases
2. Change to the Web Application that will be used with these Content Dbs.
3.  Click ‘Add a content database’
4.  Give the database a Database Name
5.  Change the ‘number of sites before warning‘, and ‘maximum number of sites‘ to a number suitable for your Site Collection, or just keep the defaults.
6.  Click Ok

This will create the new Content DB.  Do this for all Content DBs that need to be created prior to creating the Site Collections.

Back on the Manage Content Databases page you will now see all the Content DBs you just created with 0 in the Current Number of Site Collections column.

Now on to PowerShell to move the Site Collections over.

1.  Remote or log into your Central Administration (CA) server.
2.  Bring up SharePoint 2010 Management Shell (PowerShell) with Administrator Rights
3.  Next type:

Move-SPSite <http://ServerName/Sites/SiteName&gt; -DestinationDatabase <DestinationContentDb>

Where:

4.  Hit Enter.  This will move the Site Collection from its current Content DB to the new Content DB

Now go back to:  Central Administration -> Application Management -> Manage Content Databases and you will now see that there should be a number 1 listed under the Current Number of Site Collections for that Site Collection Content DBs.

Thats it!  Pretty simple!

To test try to hit your Site Collection site to make sure that the page comes up!

Advertisements
  1. January 20, 2012 at 6:53 pm

    Sounds almost too easy doesn’t it!? Are there any post move configurations that need to happen regarding search or other service applications?
    Thanks!

    • February 13, 2012 at 1:36 pm

      Hi KansasCoderRich – Are you referring to SharePoint 2007 Search and Service Applications? My suggestion since SP2010 no longer uses SSPs (Search, Service Applications). It’s alot easier to just create a new search, and new Service Applications rather then trying to move those over from MOSS 2007. Most of the Service Applications in SP2010 have their own DBs, unlike how they were configured and set up in SP2007, they relied on the SSP. Here they are dependent of themselves. Which to me makes it alot easier to manage.

  2. Lon
    March 4, 2013 at 1:46 pm

    “number of sites before warning” in step 5 refers to number of site collections. I would set this to 1 and the maximum to 0.

  3. March 4, 2013 at 2:03 pm

    Lon,

    The “Number of sites before a warning event is generated” is 2000 by default and “Maximum number of sites that can be created in this database” is 5000.

    You would not want to set “Number of sites before a warning event is generated” to 1 and “Maximum number of sites that can be created in this database” to 0.

    This would mean that no Site Collections can live in this database.

  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: