Read time: 6 minutes

Summary: Organizations often need to migrate site collections between content databases to upgrade from older versions to the latest ones. It allows them access to the latest features and security updates. Go through this article to learn how to move SharePoint sites with complete data integrity. The article also describes how to use Kernel Migration for SharePoint to securely transfer site collection.

A SharePoint site collection includes all your sites, lists, content, and templates, within the SharePoint environment. However, there are circumstances when 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’ll need to move it to a larger content database. Also, you can move small site collections located in different content databases to a single content database for ease of management.

Let’s proceed to learn about why and how to migrate SharePoint site collections from one database to another.

Reasons to migrate SharePoint site collections between content databases

Site collection migration is a time and resource-consuming task and should be done only when required. Given below are the primary reasons why you need to migrate SharePoint site collection from one database to another.

  • Manage database size: Over time, the size of the content database grows exponentially. To manage the size and increase storage, migrating site content to another database is a standard procedure.
  • Improve server performance: The overgrown database often results in diminished server performance. Transferring data and reducing the server load will help in maintaining optimal server performance.
  • Company policy: Events like a company merger or acquisition can trigger the action of migrating site collection to a different database.
  • Shifting to a better database: Sometimes, your database fails to execute queries or handle the request load. To resolve this problem, organizations must migrate to a database with high-end resources.
  • Backup or database maintenance: The migration of SharePoint site collection can be linked with creating site backup to safeguard data. Or it can simply be done due to database maintenance.

Things to know before migrating site collection

Migration is a complex task with various steps. Many SharePoint admins like to have a SharePoint migration checklist before beginning the migration. Therefore, we recommend ensuring the following conditions are true:

  • A content database should already exist as a destination.
  • Perform a thorough analysis of current SharePoint environment.
  • Get site collection administrator permissions on both source and destination sites.
  • 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.

Evaluate the size of a SharePoint site collection

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

  • ) in the command is the name of the site collection.
  • $used stores the amount of space on the disk utilized by a specific site collection and will be displayed when you run the command.

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. However, before you start the process to migrate SharePoint site collections between content databases, you need to have the following memberships:

  • security admin fixed server role,
  • db_owner fixed database role,
  • and the administrator group on the server to run PowerShell scripts.

Use the Add-SPShellAdmin command to assign permissions to run SharePoint server commands on PowerShell.

Moving a single-site collection

Follow the given step-by-step commands to move SharePoint site collection:

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

Now, follow the steps below to easily perform the SharePoint site collection migration:

Open SharePoint Management Shell and type the below command in PowerShell command prompt:

Get-SPSite -ContentDatabase| Move-SPSite -DestinationDatabase

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, during the process, you can avoid the risk of data loss by backup SharePoint Site collection using PowerShell and then restore the Site Collection to the SharePoint Server with the same technique. However, the method Move-SPSite, as described above, is the easiest manual way to move site collections from one content database to another.

Alternate solution to migrate site collections

Migrating SharePoint site collections using Microsoft PowerShell cmdlets is an approach suitable only for technically skilled users or domain experts. Running these commands accurately is not an easy task for an average SharePoint user. To simplify the migration process, we recommend using a professional tool, Kernel Migration for SharePoint.

The SharePoint migration tool simplifies the process of migrating between SharePoint versions. It features a simple user interface that allows easy operability even for non-tech users. It is packed with smart features that allow you to migrate site collections between content databases. The tool allows migrating single or multiple site collections at a time without any glitches. Let’s check out some efficient features of this tool.

  1. Migrate large sites, subsites, and the documents library.
  2. Migrate SharePoint permissions easily with the site content.
  3. Provide filters for selective site migration.
  4. Use the migration scheduler to process migration scheduling.
  5. Best tool to download a comprehensive SharePoint backup.

Using this utility, you can also migrate data from File System to SharePoint Server and OneDrive. In addition to migration, the tool is equipped with backup functionality too. You can perform Teams chat backup efficiently with the tool.

Conclusion

When site collections grow in size or you want to combine multiple site collections, it becomes necessary to migrate SharePoint site collections from one database to another. In this article, we discussed how to move site collections to another database using PowerShell commands. However, we recommend Kernel Migration for SharePoint for a faster and easier migration process.

Frequently Asked Questions

Q. How to move a SharePoint site collection to another database?

Ans: To migrate a SharePoint site collection, use the PowerShell cmdlet Move-SPSite. Here are the commands that you can run in the SharePoint Management Shell:
Single site collection – Move-SPSite <http://ServerName/Sites/SiteName> -DestinationDatabase <DestinationContentDb>
Multiple Site Collections – Get-SPSite -ContentDatabase <SourceContentDb> | Move-SPSite -DestinationDatabase <DestinationContentDb>

Q. Why do I need to backup SharePoint site collection before migration?

Ans: When migrating SharePoint site collections to another database, there are possibilities of committing errors during the process. This can eventually result in data loss or even worse, corruption in the entire database. To avoid the situation, always take a complete SharePoint site collection backup with the metadata, permissions, and other contents preserved.

Kernel Migration for SharePoint
Related Posts