Migration of Portal between Servers
Introduction:
The purpose of the document is to explain the backup and Restore strategy we took to migrate the staging portal onto the development server. There are two types of migration. One is at Site level and one is for Site Collection Level. The site collection level migration can be performed using backup and restore strategy. The site level migration can only be performed using the import/export of the sites.
I came across both the scenarios while doing migration from staging environment to development environment.
There are various ways through which we can do SharePoint backup and restore. Following are some of the main ones that are being used in the industry today:
SharePoint Backup and Restore:
This is the native backup and restore of SharePoint and can be used using the central administration. This will backup all the databases both of Configuration and Content. This can also provide you the ability to do backup of Shared Service Provider. This all can be done using the User Interface of SharePoint Central Admin backup and restore section.
STSADM Utility:
STSADM is a command line utility provided by Microsoft. This utility is installed when the SharePoint is installed. This is a very powerful utility and mostly used by experienced SharePoint developers. This utility can be used to perform a lot more tasks than we can see in the Central Administration. We can perform backup and restore using this command line as:
BACKUP
stsadm -o backup
-url <URL name>
-filename <file name>
[-overwrite]
stsadm -o backup -url <URL of the site collection> -filename <name of the backup file>
For catastrophic backup
stsadm -o backup
-directory <UNC path or local drive>
-backupmethod <full or differential>
[-item] <created path from tree>
[-percentage] <integer between 1 and 100>
[-backupthreads] <integer between 1 and 10>
[-showtree]
[-quiet]
stsadm -o backup -directory <UNC path or local drive> -backupmethod <full or differential>
RESTORE
To restore a site collection, use the following command line:
stsadm -o restore -url <URL of site collection> -filename <name of backup file>
To restore an entire farm, use the following command line:
stsadm -o restore -directory <UNC path or local drive> -restoremethod <overwrite or new>
SITE IMPORT/EXPORT:
At site level you can always use the import/export commands. For example you want to migrate data from one SharePoint Server to another. This command will only migrate the sites and not site collections.
To export your sites, use the following command line:
stsadm -o export -url <URL> -filename <FileName>.cmp
To import your site, use the following command line:
stsadm -o import -url <URL> -filename <FileName>.cmp
SQL SERVER DATABASE BACKUP AND RESTORE
In most of big corporations, SharePoint backup and recovery can be done using the SQL Server Database backup and recovery. For this it’s recommended that your organization have a DBA Environment setup with which you can do this. For our migration scenario we can utilize this.
To perform this task, you need to identify your content database for the SharePoint. Once you know that you have to inform your DBA to transfer that latest backup file from your production server to your development SQL Server.
Once the database have been registered in your Development SQL Server, then you need to perform following steps on the Development Portal.
- Copy the database backup to the server running Sharepoint 2007
- Restore the database backup onto the SQL server that Sharepoint 2007 is using.
- Open the Sharepoint 3.0 Central Administration site. This can be located at
Start->Administrative Tools->Sharepoint 3.0 Central Administration.
- Click on the Application Management tab at the top of the screen
- Go to "Create or extend Web Application" under the "Sharepoint Web Application Management" section.
- Click on "Create a new Web application" to create the new Web Application where we are going to restore our Sharepoint 2003/WSS V2.0 site to.
- Fill in the appropriate information to create a Sharepoint 2007/WSS V3.0 Web Application in your environment and click "OK"
- Once the "Operation in Progress" screen has disappeared and the create operation is completed you will be taken to the "Application Created" screen. Do not go to "Create Site Collection".
- Open a command prompt.
- Run the Sharepoint stsadm tool with the following command line:
stsadm –o addcontentdb –url -databasename
NOTE: We need to use the stsadm command line tool to add the new content database because the web application may timeout if you use it to add the content database.
- Click "Enter" and the content database will be added to the site.
- Return to the Sharepoint 3.0 Central Administration application and click on the "Application Management" tab.
- Click on the "Content databases" link under the "Sharepoint Web Application Management"
- You will be redirected back to the "Content databases" screen
- Make sure that the Web Application you just created is selected in the drop-down list of Web Applications.
- Click on the content database that was initially created when you created the web application.
- On the screen that appears click the check box next to "Remove content database".
- Click "OK". This will remove the initial database from the SQL Server.
- Your site is not ready to access. However if you are moving to a machine that has different user accounts you may have a problem logging into the new site. If you do follow the rest of the steps in the article.
- Go to the "Application Management" tab in the Sharepoint 3.0 Central Administration application.
- Click on "Site Collection Owners" located under "Sharepoint Site Management"
- Make sure the correct Web Application is selected in the drop-down
- Set the Primary and Secondary site collection owners to the correct user accounts and click "OK"
- Your site will now be ready to access with primary or secondary site collection owner account.