Individual SharePoint sites can be copied to a new location on the same server or to a different SharePoint server using the export/import flags in the STSADM utility. To run the STSADM command you must be a member of the local Administrators group on the SharePoint server.
Before starting out, make sure you know how much room you will need to create the exported file. To find the amount of space a site is using, run the stsadm enumsites command as shown below. Be sure to substitute the value for your root URL.
Stsadm –o enumsites –url <URL>
The output of the command will list all the sites, their owners and the amount of space used and allocated. Find the site and look at the StorageUsedMB value.
While the output from the export command can be directed to any file where there is room, the export will take up space temporarily on the C drive in the C:\Users\<UserProfile>\AppData\Local\temp folder or at another location if you have changed the location of the TEMP (or TMP) directory via the Environment Variables*. For this reason there must be enough room on BOTH the C: drive and the drive where the final file will reside.
Warning: SharePoint will go down if there is no space on the C: drive on the server on which it is running.
Once you are sure there is enough space, run the export. To export the site to a file use the stsadm export command as shown in the example below substituting the values for URL and the name of the backup file.
stsadm -o export -url <URL> -filename <YourBackupFileName>
stsadm -o export -url http://sp2007test/Development/Wiki -filename d:\backupofwiki.bak
If the command is entered correctly and you have the permission needed to run the export, you should see the Operation Completed Successfully message when the export completes.
Move the newly created backup file to the destination server. To import the file to create new site enter the stsadm import command as shown in the example below.
stsadm -o import -url <NEWURL> -filename <YourBackupFileName>
stsadm -o import -url http://MOSS/Production/Wiki -filename e:\backupofwiki.bak
Wait for the command to complete. You should see the Operation Completed Successfully message. If you are using MOSS with SP2, you will be able to navigate directly to the new URL. However the new site will have the same name and title as the old site. You will need to change this. Once that is completed you are done.
If you cannot navigate to the new site, check to see if you are using SharePoint 2007 with SP2. If you are behind on the Service Packs, you still may be able to get around this problem. The site was imported BUT it will not yet appear as a listed sub site. Follow the steps below to add it as a subsite.
Navigate to the parent site of the newly imported site. You must be a Site Administrator on the parent site to perform these steps.
1. Select Site Actions. A drop down list will appear.
2. Select Site Settings. A new page with a list of options will appear.
3. Under the Look and Feel section select Quick Launch. If this option does not appear you cannot get to the new site.
4. Click the New button. The New Link page will appear.
5. Enter the URL where the site was created and the Site Title in the description box.
6. Select Sites from the drop down Heading field.
7. Click the OK button.
To find the location of the TEMP directory, right click My Computer and select Properties. Depending on which operating system you have you will either choose the Advanced tab or click the Advanced system settings link, then the Advanced tab. Click the Environment Variables button at the bottom of the dialog box.