Migration is a process to migrate content from one location to another and similarly SharePoint online site collection migration is the process of moving a SharePoint site collection from one environment (such as an on-premises SharePoint server) to another environment (such as SharePoint Online in Office 365). This can involve copying all of the site collection’s content, data, and configurations to the new environment, and ensuring that the site collection functions as expected in the new environment. This process can help organizations take advantage of the benefits of SharePoint Online, such as increased scalability and improved security, while still retaining access to their existing SharePoint content and data. The migration process can be complex, so it’s often recommended to use a migration tool to help simplify the process.

Steps to Migrate a SharePoint Online Site Collection

Here are the steps to migrate SharePoint Online site collection content to another location:

Preparation:

  • Plan the migration process, including the scope and timeline.
  • Verify that the source and destination environments are compatible.
  • Create a backup of the source site collection.

Data Collection:

  • Use a migration tool or the SharePoint Online Management Shell to collect the data from the source site collection.
  • Store the collected data in a secure location.

Data Import:

  • Create a new site collection in the destination environment.
  • Use a migration tool or the SharePoint Online Management Shell to import the collected data into the new site collection.

Data Validation:

  • Verify that the data has been imported correctly and that the site collection is functioning as expected.
  • Test the site collection for any issues and resolve them.

Post-migration activities:

  • Update any URLs or links in the site collection.
  • Finalize the migration process and clean up any temporary files.

PowerShell script to migrate SharePoint online site collection

Here is an example of how to use PowerShell to migrate SharePoint Online site collection content to another site collection:

Connect to SharePoint Online:

$username = "user@mstalk.onmicrosoft.com"
$password = Read-Host -Prompt "Enter password" -AsSecureString
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $password
Connect-PnPOnline -Url https://mstalk.sharepoint.com -Credentials $cred

Backup the source site collection:

Export-PnPClientSideSolution -Identity sitecollection.sppkg -OutputPath c:\backup

Import the backup to the destination site collection:

Import-PnPClientSideSolution -Path c:\backup\sitecollection.sppkg

Verify the import:

Get-PnPClientSideSolution

We shared a basic example and when you are trying to migrate using then you need to change the PowerShell commands and parameters depending on the specifics of your migration, such as the size of your site collection and the migration tool you’re using. It’s recommended to use a migration tool to simplify the migration process, as the process of migrating a SharePoint Online site collection can be complex and time-consuming.

Adnan is six time Microsoft MVP (Since 2015) with over 16 years of extensive experience with major expertise on SharePoint, SharePoint based development, Microsoft 365, Microsoft Teams, .Net Platform and Microsoft BI. He is currently working Sr Microsoft Consultant at Olive + Goose. He is MCT Regional Lead for Pakistan Chapter since 2012. He is working on SharePoint for past 12 years and worked on different intranet/intranet solutions for private & govt. sector majorly in United states and Gulf region and have experience of working with multiple Fortune 500 companies. He is a trainer, technology evangelist and also speaks in community forums.

Leave a Reply