How to copy a sitecollection to a new content database

This post shows how to copy a sitecollection within the same farm. Very useful to do some testing where you don’t want to mess up your content.

Lets pretend that you have a sitecollection that uses the content database WSS_Content_Source. Now we want to copy this sitecollection within the farm and with a new content database.

The operation can be broken down into these steps.

1. Backup a sitecollection
      using stsadm “stsadm -o backup -url -filename sourcesitecollbackup.bak”

2. Create a new webapplication (using central admin)

      port: 80
      hostheader: (remember to add a hostheader to c:\windows\system32\drivers\etc\hosts – if you aren’t using a DNS server)
      contentdatabase: WSS_Content_Dest

3. Create a sitecollection (using Central admin)

      Same language and template as the source (or perhaps I think you could create a blank one – havent tried)

4. Restore your backup

      using stsadm:” stsadm -o restore -url -filename sourcesitecollbackup.bak -overwrite” (remember to overwrite)


You should now have a exact copy of your source sitecollection on the with its own content database



, , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: