Microsoft Office SharePoint 2007 (MOSS) Data Protection & Recovery Explained
Before diving into SharePoint data protection and recovery practices, let's elaborate a little bit about the levels of data recovery.
Logically we have 4 levels of data recovery:
- Content LevelContent stands for uploaded files, lists and web parts. This level is the most common and happens when users delete or update content then want to roll back or recover deleted items. Such scenario can be solved on the user level using the Recycle Bin, History Control, Closed Web Parts, etc.
- Sites LevelLoss of site availability because of deletion or data corruption. This will require the administrator to restore a site collection backup on some test server, export the missing site and import it back. The more frequent backup schedulers run the better data protection and accurate recovery you provide. Such scenario can be solved only on the administrator level using STSADM. SharePoint Designer 2007 can be used to conduct the export/import steps, but I prefer using STSADM all the way for faster access, no GUI, and no Mouse. I think black command screens and remote desktop pleads more to my administrative ego needs!
- Site Collections LevelLoss of site collections because of deletion or data corruption. This will require the administrator to restore a site collection backup directly. Loss of sites and content is something being dealt with on regular bases since generally it's the users fault, but when it comes to Site Collections this will raise a question mark about what really happened and how. I've seen some SharePoint deployments that run on one site collection which unfortunately is a bad practice and risks the portal availability.
- Farm LevelHappens on hardware failure, database loss or by some meteor landing on your data center! The administrator will use Central Administration to restore a full farm backup. STSADM Catastrophic Backup /Restore operations can be used as well. This backup will include all applications, SSP, and configuration.
To wrap up check the diagram below (original diagram by Martin Kearn). I added annotations to help you understand more.
As a SharePoint guy I would recommend that you use tool for managing Data Protection and Recovery such as: Microsoft System Center Data Protection Manager 2007, DocAve Backup and Recovery for SharePoint and Quest Recovery Manager for SharePoint. Handling backups your self is a big responsibility, however if you come from a corporate environment you'll be stuck in a 6 months purchase order and enroll in a politics major league with the operations team, then I would strongly recommend to lose the headache and use available tools like STSADM and SharePoint Designer.
Content Level Data Recovery
From time to time users delete documents or lists by mistake, close web parts and update documents with incorrect information. If you were formatting a table in Word, and accidently you applied wrong format, by instinct you'll reach the magical ctl+z undo keys - don't you wish they exist in reality – and taraaa problem solved.
In SharePoint we have a crl+z key and it's called the SharePoint Recycle Bin. I won't look at the Recycle Bin as a backup tool as such, but it is defiantly the instinct ctrl+z. Content can be restored easily from there. The drawback in Recycle Bin that content inside does expire. In Windows it is set to a limited size and starts overwriting files. Same story goes for SharePoint but it is limited by an expiry date. By default items expire after 30 days.
Site Collections & Sites Level Data Recovery
Sites are too big to fit in the Recycle Bin from a complexity perspective. The only way to restore them is through-out previous backups. Currently I run daily backups for all my site collections, this comes very handy when you are restoring sites. Using Farm backups will consume big restoration size and time. Instead I keep my farm backups running for catastrophic failure recovery and I run in addition the site collection backups every night to be able to restore any sites in a super effective time.
Site Collections backups are done using STSADM and Windows Tasks Schedulers. The process is simple:
- Create a batch file and include the following:
- Create a scheduler using Windows Task Schedulers setting it up to run every day outside of office hours.
For restoring the site collection we use STSADM as well. Just launch the Command-Line and type:
Remember that you can only run STSADM on SharePoint server.
Sites require an extra step which is exporting the site from the restored site collection and import it back again. This can be done by using either STSADM or SharePoint Designer. I SharePoint Designer has a drawback, it can only export/import sites that does not exceed 25 MB of size. If the size exceeded it won't prompt at all but you will get the errors during the restoration process. The error will be something like this: Cannot find c:\...\exportsettings.xml. You can find the work around here.
To Export/Import a site using STSADM, launch the Command-Line and type:
- Site Export
- Site Import
Farm Data Recovery
When it comes to farm backup/restore operations we call it a catastrophic backup or a catastrophic restore. The catastrophic backup/restore holds up almost everything in SharePoint, from solutions, configuration, content and SSP. You can carry on these operations either using Central Administration (under the Operations tab) or STSADM.
Like site collection backups, you can place the command in a batch file and create a windows scheduled task to run it every day to insure that your farm is backed up.
- Perform Catastrophic Backup using STSADM
- Perform Catastrophic Restore using STSADM