The PowerShell cmdlet Export-SPWeb allows to export SharePoint sites, lists and libraries to a disk location. The -Path attribute allows to specify disk location and filename of the backup file.
The stsadm.exe application can be used basically for the same purpose with the syntax:
stsadm -o export
In this case, the -filename attribute determines the disk location and filename of the backup file. stsadm.exe is located in the BIN folder of the SharePoint hive:
- ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14′ for SharePoint 2010 or ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15‘ for SharePoint 2013.
If your SharePoint WFE is equipped with a small system volume and a large data volume, you can be sure to not run out of disk space in the system volume by using wisely the -Path or -filename attributes, right?
Nope.
Both commands first export the selected data to the TEMP folder specified by the %TEMP% environment variable, which is located by default on the system volume. Only after completion of the export job, the resulting compressed file(s) are moved to the specified location.
This poses a serious risk of running out of space on the system volume, with the consequences that you can easily imagine.
The solution is to temporarily change the value of the %TEMP% variable to point to a disk location with enough space.
In the command prompt, ECHO %TEMP% shows the current TEMP folder path. Its value can be modified by using :
- Computer -> Properties -> Advanced System Settings -> Advanced -> Environment Variables