Thursday 25 February 2016

How to create a new Site Collection from an existing one.

Recently I had a requirement to create a exact same copy of one site collection to another new web application.

I used following power shell comdlets to do the job very quickly.

http://xxxx:6203--> This is my root level site collection that I want to copy and spin a new site collection on a new web application.

http://xxxx:43583 --> My New Web application that is just created and no site collection is assigned to it.

Step 1: Create a back up from the source site collection

Backup-SPSite -Identity "http://xxxx:6203" -Path "C:\YS\abc.bak"

Step 2: Create a Web Application

Step 3: Do not create a site collection for new Web Application as we will use our backup to do that.

Step 4: Restore the backup on the new Web Application where http://xxxx:43583 is Web Application url.

Restore-SPSite "http://xxxx:43583" -Path "C:\YS\abc.bak"

Step 5: Verify and test.