This is a guide on how to create a copy of one Site Collection to another. This is for SharePoint Online Only, for On premise have a look at the restore-spsite cmdlets on the SharePoint Server.
Before you start if this guide The user running the scripts, must have the following permissions,
- The User must be a Term Store Administrator.
- The User must be a SharePoint Administrator with access to the Admin Center.
- The User must be a Site Collection Administrator in both the source and destination sites.
- Custom Scripting must be enabled on both source and destination sites.
With the latest SharePoint modern experience, Microsoft had decided to turn off some features, and one among them was Custom Scripting. Unfortunately, to do the SharePoint provisioning, we will have to enable the Custom Scripting.
According to Microsoft, below are the features which will not be available until you manually enable the custom scripting.
- Save Site as Template
- Save document library as template
- Solution Gallery
- Theme Gallery
- Help Settings
- HTML Field Security
- Sandbox solutions
- SharePoint Designer
- Uploading files that potentially include script
To allow custom script on other SharePoint site collections, you will have to download the download the latest SharePoint Online Management Shell. Once you are done you can perform the below commands.
Once we have enabled the custom scripting it is time to add you as the Term Store Admin, again you can always reach out to your Tenant admin to add you as a Term Store Admin. You can ask your Tenant admin to perform the preceding steps.
- Sign in to Office 365 as a global admin or SharePoint admin.
- Click on the app launch icon( 9 dots) and then click on Admin to open the Microsoft 365 admin center.
- Select Admin centers and then click on SharePoint.
- Now, you should see an option as Term Store and click on it.
- He/She can add your mail id in the text box near to the heading Term Store Administrators Once it is done you can always go to your Site Settings > Term Store Management > Term Store Administrators.
The first thing to do is, to connect the source SharePoint site, you can do that by using the preceding command. Make sure you have the PNP PowerShell installed...
Now we have an XML file which has everything we need to move. Connect your destination site by following the command below.
Congratulation, we have successfully moved all of our data and almost everything from one SharePoint site to other.