What is the correct way to migrate SharePoint 2013 Foundation Site Collection to other farm?
-
06-01-2021 - |
Question
I am having SharePoint 2013 Foundation environment. I have created a Web Application and then created a root level Site Collection.
I have developed a custom application using HTML, JavaScript, and CSS. The resource files are stored in Style Library folder.
Now I want to move all the development to new Root Site Collection of the Web Application in another farm.
How can I achieve this?
I want to avoid the process of uploading all files to new Site Collection's Style Library, creating all the pages in Site Pages and referencing the files in Content Editor Web Part.
Solution
You have two options
- Database-Attach upgrade.
- Backup and Restore.
Prerequisites
Make sure that the SharePoint Build number of destination environment is higher than or the same build number of the source environment, to check this.
Database-Attach upgrade Steps
- In source farm, Take a backup of the content database that holds your site collection via SQL Management Studio.
- In destination farm, Create A web application, Site Collection.
In destination farm, Dismount the web application content database, via this command
Dismount-SPContentDatabase "<ContentdBName>"
In destination , via SQL Management Studio , Restore the content database.
In destination , Mount it to the created web application,
Mount-SPContentDatabase "<ContentDb>" -DatabaseServer "<DbServer>" -WebApplication http://SiteName
In destination farm, Change Site Collection administrator to avoid the access permission issue. by going to site Setting > Site Collection Administrator.
Finally, deploy your custom web part solutions as mentioned at Install and deploy a SharePoint (WSP) Solution Package using SharePoint Shell
BackUp and Restore Site collection
Take a backup of site collection from the source farm.
Backup-SPSite -Identity http://siteURL -Path "C:\\MoveSiteCollection.bak"
Restore the backup.
Restore-SPSite -Identity http://url -Path "C:\\MoveSiteCollection.bak"
For more details check