At times, we need to just back up a site collection from one Farm or a Web application and restore it to a new Farm or a Web application. In order to do this, we can use the stsadm commands as shown. Follow these steps outlined below to complete the task:
stsadm -o backup -url [Source_SiteCollection_Url] -filename [Your_SiteCollection_Backup_file]
stsadm -o restore -url [Destination_SiteCollection_Url] -filename [Your_SiteCollection_Backup_file] -overwrite
where Your_SiteCollection_Url is the url of the site collection and Your_SiteCollection_Backup_file is the name of the backup file.
P.S: If you got the message 'No content databases are available for this operation' it means the site collection with the same ID is already present in the destination content db.
To overcome this, you can:
- attach a new content db to the web application and try again. Site Collection will be restored to this content db automatically
- change the destination web application to another one
- delete the site collection with existing ID on destination web application.
Note: The -overwrite option would overwrite the existing site collection. You might want to backup the existing site collection just in case.