Move Site Collection to Another Content Databases in SharePoint 2007

In SharePoint 2007 content databases can grow till 100 GB. What if you want to move your existing sites to a new content db?

Well, Here is the manual way to move site collection to a different database in SharePoint 2007:

  • Backup and Delete the Site Collection
  • Set all your Content Databases’ maximum allowed sites to the number of current sites.
  • Set the Content Database you want the Site Collection to go into to allow one more Site Collection.
  • Restore the Site Collection
  • Adjust your Content Database maximums to allow new sites to be created. 

SharePoint 2007 move site collection to another content database – STSADM way:
You need to know your source DB, where your site resides first. How do we know what is the content DB for a particular site collection? Well, you can retrieve that information by running the stsadm command. Here is the command:
stsadm -o enumsites -url https://webapp_host_header > c:\sites.xml

Now, we’ve got and decided our source and destination DB’s. ready to move the site? Here you go

stsadm -o mergecontentdbs -url https://web_App_URL -sourcedatabasename <Source DB Name> -destinationdatabasename <Destination_DB> -operation 3 -filename c:\output.xml

Another nice way to move SharePoint Site collections between Content Databases: Use SharePoint Admin Tool kit – https://www.microsoft.com/downloads/details.aspx?familyid=BE58D769-2516-43CB-9890-3F79304528FF

It provides central Administration UI to move SharePoint site collection from one database to another

sharepoint 2007 move site collection to another database

In case, you want to move the sites between Farms, You will have to backup/restore or export\import to move site collections.

Its always a good idea to take backup before doing these operations 🙂

In SharePoint 2010 and later, we’ve Move-SPSite cmdlet. Here is how: Move Site Collection to Another Content Database using PowerShell

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

7 thoughts on “Move Site Collection to Another Content Databases in SharePoint 2007

  • Hi,
    I have a site collection for about 37GB and moved successfully with Move-SPSite, but not with 39GB site. Always got Execution Timeout Expired.

    Reply
  • Hi Salaudeen,
    This looks very useful but wondering if you can give me advice on my situation.
    I have a VERY LARGE site collection that has content database current size close to 450 GB. I have inherited this environment from another administrator who created all the sites within the same site collection and there are lots of sites with some of them 32 GB individual site size. I want to now move these large sites out of this one site collection to try and bring down the overall size to below 100 GB.
    How do you suggest I can do this. The performance of some of the sites is degrading due to this.
    Is there any proven way I can move individual sites to a new site collection? I am worried that if I use a powershell script or stsadm the export site commands might timeout due to the size of the sites and also worried about the import step.
    Any advice will be greatly appreciated.
    Thanks,
    Anant

    Reply
    • Anant,
      1. In my experience, I’ve successfully moved Site collections of 100 GB to new database with no issues with Move-SPSite.
      2. Always Take Database backups before doing such moves!

      Reply
  • Really helpful!
    What if there is variation on your site collection?
    How can you copy / move to another site collection?
    Let’s say from Production to Test?

    Reply
    • Since variations cannot be backup/restore by MOSS, Use this trick:
      1. Backup your site with: stsadm -o backup
      2. Create a New Site collection, create Variation labels as same as in your backed-up site or use Variation Editor: https://variationseditor.codeplex.com
      3. Restore the backup by overwrite the new site created: stsadm -o restore with “–overwrite” parameter.

      Reply
  • This was extremely helpful! Thank you!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *