Thursday, June 20, 2019

Make a Copy of a SharePoint Site (for testing)

The other day I wanted to test out something in SharePoint 2016, but I didn't have a test environment.But I also didn't want to test it out in production. So what do I do? I needed to make a copy of my SharePoint site into another site collection.

Here is what I did:

1) Create a new site collection in Central Admin
2) Delete the site from the site collection

3) RDP to the SharePoint Server
4) Open up PowerShell ISE
5) Copy and run this command:


# imports SharePoint powershell
if ( (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null )
{
    Add-PsSnapin "Microsoft.SharePoint.PowerShell"
}
#copy web
Copy-SPSite https://portal.contoso.com -DestinationDatabase WSS_Content -TargetUrl https://portal.contoso.com/sites/test


You will need to change the site source, destination, and database name when you run this command.



Source: https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/copy-spsite?view=sharepoint-ps

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.