Read time 9 minutes

A SharePoint site collection includes all of your sites, lists, content, and templates, which makes it the most crucial part of your SharePoint environment. But there are certain circumstances in which you might need to migrate your site collection from one content database to another. For instance, if a site collection outgrows the content database on which it resides, then you need to move it to a larger content database. Also, you can move small site collections in different content databases to a single content database for ease of management.

In this article, we will discuss how you can migrate a site collection from one database to another with PowerShell Commands. Also, we have provided an alternate solution to migrate SharePoint site collection from one content database to another.

Things to Know Before Migrating Site Collection

Before beginning the migration, make sure that the following conditions are true:

  • A content database should already exist as a destination
  • The source and destination content database must be located on the same instance of the SQL server
  • The source and destination content database must be attached to the same web application

Also, it is necessary to analyze the size of the source site collection because the auditing data is also copied while moving the site collection. If the auditing data is large, you can archive and trim the audit data using PowerShell.

To find the size of a site collection, run the below command in SharePoint Management Shell:
$used = (Get-SPSiteAdministration -Identity <http://ServerName/Sites/SiteName>).DiskUsed

Also, make sure that the destination content database has enough space to accommodate the source site collection. It is recommended to have a free space three times the size of the site collection.

Moving Site Collection Between Content Databases

To move the site collection, you need to use the Move-SPSite command in PowerShell. Using this command, you can move a single site collection as well as multiple site collections to a new content database.

Moving a single-site collection

To move a single SharePoint site collection, you need to have the following memberships – securityadmin fixed server role, db_owner fixed database role, and the administrator group.

  • Open SharePoint Management Shell and type the below command in PowerShell command prompt:
    Move-SPSite <http://ServerName/Sites/SiteName> -DestinationDatabase <DestinationContentDb>
    Here, http://ServerName/Sites/SiteName is the name of a site collection, DestinationContentDb is the name of the destination content database.
Moving Multiple Site Collections

You need to have the same memberships as mentioned above to move multiple site collections from one content database to another.

  • Open SharePoint Management Shell and type the below command in PowerShell command prompt:
    Get-SPSite -ContentDatabase <SourceContentDb> | Move-SPSite -DestinationDatabase <DestinationContentDb&gt;
    Here, SourceContentDb is the name of the original content database and DestinationContentDb is the name of the destination content database.

Using these commands, you can easily migrate site collection from one content database to another. However, there is another method to migrate site collection from one server to another – using the backup and restore of the SharePoint site collection.

With the backup & restore method, you need to backup SharePoint Site collection using PowerShell, and then restore the Site Collection to SharePoint Server with the same technique. However, using Move-SPSite, as described above is the easiest way to move site collections from one content database to another.

Alternate Solution to Migrate Site Collections – Kernel SharePoint Migrator

Kernel SharePoint Migrator is an advanced utility that makes it easy for users to migrate between SharePoint versions. It comes with smart features that allow you to migrate site collection between content databases. Also, it allows migrating single or multiple site collections at a time without any glitches. Permission migration, selective migration, migration scheduling, etc. are some of the special features of the tool. Using this utility, you can also migrate data from File System to SharePoint Server and OneDrive. Also, SharePoint Migration software offers a simple working process, which makes it easier for non-technical users to migrate their data.

  1. Download and configure the software on your system.
  2. Launch the tool, and the home screen will appear on your screen. Click Add New Source and select SharePoint Server from the drop-down.
    Launch the tool
  3. The Add New Site wizard will appear on your screen. In this section, give a name to the project, provide the Site Address, user credentials, and then click Find Site Collection.
    Add New Site
  4. In the Find Site Collection wizard, provide the required details for SharePoint Site and click Next.
    Find Site Collection
  5. The Site Collection URLs will appear on the screen, select the required Site Collection, and click Finish. The source site will be added to the tool.
    Site Collection URLs
    Note: Make sure you don’t add the same site as both Source and Destination. The tool prompts a message to add the same Server as both Source and Destination while adding SharePoint Server.
  6. Similarly, you can add another SharePoint Server as a destination in the tool.
    add another SharePoint Server as a destination
  7. Once both source and destination SharePoint Server are added. Right-click on the Source Site Collection and select Copy.
    source and destination SharePoint Server are added
  8. Now, in the Destination section, right-click on the SharePoint Server and click Paste.
    Destination section
  9. The migration dialogue box will appear on the screen. Here, you can add another SharePoint Site for Migration, else click Next.
    SharePoint to SharePoint
  10. In the next step, select Migrate as site collection and provide the details for the destination SharePoint Server, and then click Next.
    Migrate as site collection
  11. In the next step, give a Title to the migration process with a description, provide a Site Collection URL, and then click Next.
    provide Site Collection
  12. Select the required copy options and click Next.
    Select the required copy options
  13. You can select whether you want to migrate permissions or not and then click Next.
    migrate permissions
  14. Kernel SharePoint Migrator allows you to schedule the migration process or perform it immediately. You can make your selection accordingly, and then click Next.
    chedule the migration process or perform it immediately
  15. The summary of the migration process will appear on the screen, verify the details, and click Next.
    migration process will appear on the screen
  16. The tool will start migrating Site Collection from the source to the destination.
    tool will start migrating Site Collection
  17. Once the process is complete, a migration summary will appear on the screen, click Finish to end the process.
    process is complete

That’s how you can easily migrate SharePoint Site Collection from one server to another with the help of Kernel SharePoint Migrator.

Conclusion

When site collections grow in size or when you want to combine multiple site collections, it becomes necessary to migrate site collections from one database to another. Here, we have discussed how you could migrate SharePoint Server Site Collection from one content database to another with the help of PowerShell commands. Also, we have discussed a useful tool – Kernel Migrator for SharePoint for the migration of site collection from one content database to another.

Kernel Migration for SharePoint