Wednesday 3 August 2011

Site copying approaches using STSADM commands and site manager in sharepoint 2007

Hi,

Often I have seen people trying to find the correct copying approaches to be used to sites from one location to other in Sharepoint 2007.


1. Use site manager to copy down the site from one location to other. This process can be used only if the source and destination sites are in the same site collection
Process:
a) Type this in the URL of your subsite's URL  /_layouts/sitemanager.aspx. For example if I have the subsite URL as http://rahulsite/subsite/Pages/default.aspx it should be http://rahulsite/subsite/_layouts/sitemanager.aspx .

b) There will two panels in this result page the left panel and the right panel. The left panel will be consisting of   nodes representing sites and the contents within them. You will find the node of the subsite in the previous step is selected. Just click on that and select copy option this will open up a dialog box where you need to select the location where you want the site to be copied. For example if you want your site to be copied at http://rahulsite/subsite1/subsite then you need to select the node of the site http://rahulsite/subsite1 .

c) Once you have selected the node wait for the dialog box to reload itself. Do not do anything till it reloads completely.

d) Now simply click on OK and then your site will be copied over to the next location.

The advantage of this approach is that the lists column data "Created By", "Modified By","Created date" etc remains intact and does not show the values as if they are just created. The disadvantage is that using sitemanager  creates long running queries and can cause performance issues, hence it should be carried out during off business hours only. The detailed logs of these operations can be obtained from Long running operations status list created at the top level site of the site collection. This list is a hidden list and you can reach out to this by directly typing the name in the URL. For example if my top level site is http://rahulsite/top I will enter as http://rahulsite/top/long running operation status.

2. Use STSADM export/import commands for copying of the site: This is a really very good method since it does not copy down the GUIDs and it creates new GUIDs after import. The syntax can be referred at

http://technet.microsoft.com/en-us/library/cc262759(office.12).aspx
http://technet.microsoft.com/en-us/library/cc261866(office.12).aspx

This method can be applied to copy the entire site collection as well as subsite.
There is a limitation in this method such that the template used by the source and destination site must be same. However while copying subsite if the destination site does not exist then during import command it creates the subsite automatically. However this is not the case when importing a site collection, henec in thie case an empty site collection has to be created first, this can be done via STSADM createsite refer the syntax at http://technet.microsoft.com/en-us/library/cc262594(office.12).aspx
Do not use template flag in the command. After this import can be carried out in the created site collection.

3. STSADM backup/restore operation:
This method can be only applied at the site collection level. This can not be used to copy subsites.
This command has a limitation of copying only 25 GB of data hence it is not suitable for huge site collections and can cause timeout errors. Another disadvantage is that while  taking the backup it puts read only lock to the site collection hence this operation must be carried out during non business hours. The another disadvantage is that during backup it also takes the GUIDs of all items and same is applied to the destination site, hence there are always chances of errors coming during user operations. Application pool recycle is a temporary solution for these errors. The syntax of these commands can be referred at

http://technet.microsoft.com/en-us/library/cc263441(office.12).aspx
http://technet.microsoft.com/en-us/library/cc262087(office.12).aspx

Thanks,
Rahul Rashu







No comments:

Post a Comment