Thursday, September 10, 2009

How to Share backups of SharePoint SItes with your customers?

We are runing periodical backups using STSADM.exe. To do it we use a batch file that incldues all the instructions we need to: run the backup and specify the storage location.
The backups we use are "name.dat" and that extension is not supported by default by IIS. That means that a user would not be able to download it.

Why would I need a user to download the .dat file? Because that user is a customer and providing them with a copy of her/his site backup is a good way to decrease risk in case of emergency.

The first idea would be to share within his own SharePoint site a folder where to store the backups. But that is not a good idea because otherwise the next backup will make a backup of the site plus all the backup files inside... and end with a huge file size. It would also overcrowd the SQL Server unnecessarily.

My second idea is I think better, I made an IIS Web site, without SharePoint, and created all the folders (virtual directories from IIS) needed for each one of my customers to have a URL, something like I made the right permissions of course so only their administrator could access that. Wel having tens of customers is a problem for permissions... (maybe there is a good way to automate the process).

The customer folders are set to let "browse" and "read". That makes the files within the folder visible and downloadable. Now the problem is that IIS does not support ".dat" files by default for security reasons. What you need to do to solve the problem is to create a MIME type:

Associated Extension: .dat
Content Type(MIME): application/octet-stream
Check the instructions.

Now we have a new service to include in our hosting service!