Read time 9 minutes
A SharePoint site collection includes all your sites, lists, content, and templates, which makes it the most crucial component of 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.
Reasons to migrate SharePoint site collection between content databases
Site collection migration is an expensive task and should be done only when required. Given below are the primary reasons for such a complicated & time-consuming operation.
- Manage database size: Over time, the size of the content database grows exponentially. To reduce 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.
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 – security admin 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
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 membership 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
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, another method to migrate site collection from one server to another is 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 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 sites collection using Microsoft PowerShell cmdlets is an approach only for technically skilled users or domain experts. Execution of these commands accurately is not an easy task for any normal or average SharePoint user. Therefore, to simplify the migration process, we recommend using a professional tool; Kernel Migration for SharePoint.
The SharePoint migration tool is an advanced utility that makes it easy for users to migrate 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. SharePoint permission migration, selective migration, migration scheduling, etc., are some of the special features of the tool that are designed to serve your requirements.
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 site collections from one database to another. Here, we have discussed how to do this using PowerShell commands. However, we recommend employing Kernel Migration for SharePoint for a faster and easier migration process.
The content database for my collection of sites is currently large. A previous administrator had created all of the sites in this site collection by himself. I was struggling for a resolution but the manual method above helped me solve all my existing migration problems.