Running out of disk space on the C: drive
When running an export using stsadm, we kept filling up the C: drive despite exporting to a separate drive. The reason for this is that SharePoint writes temporary files to the location defined by the %TMP% variable. This defaults to the C: drive!
To fix, open a command prompt and type:
set TMP=E:\Tmp
(replace E:\Tmp with the drive and folder you want to use for your temporary storage). Then run the stsadm export and it should work!
Commands to export and import a named site
The command we used to export the site was:
stsadm -o export -url http://old-sharepointserver/hostedsites/development -filename e:\development.cab -includeusersecurity -versions 4 -overwrite
The above command will export the site called "development" referenced at http://old-sharepointserver/hostedsites/development to a file called development.cab. The security information will be included in the export as will all versions of documents.
To import, the following command was used on the new server:
stsadm -o import -url http://new-sharepointserver/development -filename development.cab -includeusersecurity
Note that we are importing the site "development" into the top level and not as a subsite beneath hostedsites. If the name of the site is omitted, the top level site is overwritten!
The gotchas
When running the import, we received the following message:
"The file cannot be imported because its parent web <site path> does not exist"
This error is not helpful and for us the problem was permission related. We had used users (albeit domain admin accounts) to export and import the data that were different from the site collection administrators. To fix we had to do the following:
Make sure the site collection administrator is the same on both the source and destination servers.
When running the export and import, make sure you are running the stsadm commands as the site collection administrator. This ensures the permissions are aligned and the import should work.
stsadm Import error: The 'ASPXPageIndexMode' attribute is not declared
Not sure what the cause of this error is, but we found a fix online:
To get round it I edited C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\DeploymentManifest.xsd on the destination server:
under section
<!-- SPWeb definition -->
I added the following.
<xs:attribute name="ASPXPageIndexMode" type="xs:string" use="optional"></xs:attribute>
<xs:attribute name="NoCrawl" type="xs:boolean" use="optional"></xs:attribute>
<xs:attribute name="CacheAllSchema" type="xs:boolean" use="optional"> </xs:attribute>
<xs:attribute name="AllowAutomaticASPXPageIndexing" type="xs:boolean" use="optional"></xs:attribute>
With these gotchas overcome, we were able to successfully import the new site.