Restore Procedures


Now you know how to make backups of the SharePoint data; you also know that some information like custom site definitions, CSS files, and XML files are not covered by the standard backup tools that SharePoint provides. These files need to be backed up with the usual file backup procedures; for example, the Windows Backup tool that comes free with Windows 2003 Server, also known as NTBackup.

But the big question is how to restore data from these backups in case of a disaster. The answer to that question depends on what you need to restore, and what type of backup you have. Remember the first golden rule (what you back up is what you can restore); so if you only run an STSADM backup of site collections, then all you can restore is a site collection; that is, you cannot restore just one specific site or library from that backup set. If this is what you need to do, then you must first restore to a temporary location and then move the data to the production environment.

The following sections describe how to restore different types of data, such as single documents, a site collection, or a complete portal server. Remember that all these descriptions are based on the backup tools that come with SharePoint; later on in this chapter you will learn more about what third-party backup tools can do.

Restoring a Single Item

At long last is the Recycle Bin back in SharePoint. It was introduced in SharePoint Portal Server 2001, and then disappeared in SharePoint Portal Server 2003, and now it is back again; we are all grateful for that! The absolute most common cause for a restore operation in the previous SharePoint version was that a user deleted a document and then wanted it back again. Now this is a breeze, since even the user himself can do this undelete operation of single items, thanks to the Recycle Bin feature available in all sites, both MOSS and WSS. You do not have to activate anything to make this Recycle Bin work; it is enabled by default and works like this:

  • q When a list item, such as a contact, or a library item, such as a document, is deleted, it is copied to the Recycle Bin.

  • q If a complete list or library is deleted, it is copied to the Recycle Bin.

  • q A user can open the Recycle Bin and restore the object.

  • q The deleted object will stay in the Recycle Bin for 30 days by default.

  • q After 30 days, the object is moved from the site's Recycle Bin to a site collection Recycle Bin.

  • q Only the Site Administrator can restore objects from the site collection Recycle Bin.

Improtent 

Note that the Recycle Bin cannot restore deleted sites or site collections.

You can configure how long SharePoint will store deleted items in the Recycle Bin; this setting is set per web application. That is, if there are multiple site collections using the same web application, they will all have the same Recycle Bin settings.

Try It Out Configure the Recycle Bin

image from book
  1. Log on as the SharePoint administrator, and start SharePoint Central Administration.

  2. Switch to the Application Management page.

  3. In the SharePoint Web Application Management section, click Web application general settings.

  4. On the next page, enter the following values (see also Figure 14-5).

    image from book
    Figure 14-5

    1. At the top, make sure that you are looking at the right web application; if not, click on its URL, and select Change Web Application.

    2. At the end of this page is the Recycle Bin section. Configure the option Recycle Bin status: (Default: On). This setting controls whether the Recycle Bin feature is available or not on the web application, and therefore its site collections.

    3. Use the Delete items in the Recycle Bin to define how long items will stay in the Recycle Bin that the user can use (Default: 30 days).

    4. Use the Second Stage Recycle Bin to define how long deleted items will stay in the site collection's Recycle Bin that only the administrator can use (Default: 50 percent of the disk quota for the web application. For example, if you have allotted 1000 MB of space for the web application, SharePoint will add 50 percent more (i.e., 500 MB) to that quota (a total quota of 1500 MB) to be used for the second-level Recycle Bin. When this limit is exceeded, the oldest items will be removed from the second stage Recycle Bin.

To recover items, the user simply opens the Recycle Bin, using the link in the Quick Launch bar, then selects the item to be restored and clicks Restore Selection. To recover items that have been removed from the first stage Recycle Bin, you must be a site collection administrator. The following example describes how to restore items from the second stage Recycle Bin.

image from book

Try It Out Recover Items from the Second Stage Recycle Bin

image from book
  1. Log on as the site collection administrator, and open the top site in the site collection where the item is to be restored.

  2. Click Site Actions image from book Site Settings image from book Modify All Site Settings (or just Site Actions image from book Site Settings for a WSS site), then click Recycle bin in the Site Collection Administration section.

  3. All deleted items will now be listed; select the one to restore, and click the Restore Selection button. Note that the Quick Launch bar at the left also has a link for displaying items that the user has manually selected to be removed from a first stage Recycle Bin. If you don't find the item you are looking for in the first list, click the link Deleted from end user Recycle Bin.

Improtent 

Rule #7: By using the Recycle Bin any item, including a previous version, can be restored.

image from book

What happens if you need to restore a single document or a list after they have been deleted from the Recycle Bin, and all you have is a backup of the complete site collection? If this is the case, you can restore the site collection as a new site collection on the production server and then move the data the same way as described earlier in this chapter. The big advantage of this restore technique is that you do not need a dedicated restore server. Follow the steps in the next Try It Out for this type of restore process.

Try It Out Restore a Single Document from an STSADM Backup

image from book
  1. Find the latest backup file containing the document. In this example, the file is stored in the backup for the site collection IT: C:\Bkup\it.bak.

  2. Since the backup file contains a complete site collection, you most likely don't want to restore this information back to the original location, since that would overwrite a lot of data. But you can restore it to another site collection on the same SharePoint server. Before you can do that restore, you must first create a new content database for this new site collection: Open a command prompt window and enter the following command (on one line).

         STSADM.exe -o createsiteinnewdb -url "http://srv1/sites/Restore" -ownerlogin↩     "filobit\administrator" -owneremail administrator@filobit.com 

  3. You now have a content database for restoring any site collection to the URL address above. The next step is to run the restore procedure: Open a command prompt and type (on one line):

         STSADM --o restore -url http://srv1/sites/restore↩     -filename c:\bkup\it.bak -overwrite 
  4. The temporary site collection is now active and has the exact same settings as the original site collection. Use a web browser to open the site in this collection where the document is stored, locate the missing document and copy it to the production site, as described in the earlier section in this chapter "Moving and Copying Information".

    Improtent 

    If you cannot open the newly restored site collection, then open a command window and run an iisreset.

  5. When the document is restored to the production environment, this temporary site collection can safely be deleted, if needed. A quick way to do this is to use STSADM (see below). Just make sure to delete the right site collection! Note that you don't need to delete this site collection; you can still restore new site collections to it, as long as you use the switch –overwrite to overwrite it in step 3.

         STSADM --o deletesite --url http://srv1/sites/restore 

Next time you need to restore a site collection you don't have to create a content database first; that is, you can omit step 2 above. This process can be used to restore any site collection in the future.

What if you only have a backup set created with the Central Administration tool and need to restore a single document? This requires a separate server; there is no way to restore that information to a temporary location on the production server, as you could for STSADM backups. Use the following steps to restore a single document from a backup made in SharePoint Central Administration.

image from book

Try It Out Restore a Single Document from a Backup Made with SharePoint Central Administration

image from book
  1. Find a temporary server that you can use as a temporary SharePoint server. Note that you can use MS Virtual PC or VM-Ware when creating this server; it does not have to be a physical server.

  2. Install the same SharePoint release, including service packs, as on the production server. You can use a local SQL Server in this temporary environment, regardless of how the production server is configured. Make sure to install the MS SQL Server Client Tools and apply the same MS SQL Server service packs as in the production environment.

    Improtent 

    The temporary server doesn't need to have the same name as the production server!

  3. Locate the latest backup files, in this example in C:\Bkup.

  4. Start SharePoint Central Administration and switch to the Operations page, then select the link Restore from backup in the Backup and Restore section.

  5. The restore process consists of four steps:

    1. Enter the backup location; for example, \\srv2\bkup. Click OK.

    2. You will see a list of all previous backup instances stored in that backup location (see Figure 14-6). Select the backup instance, and click Continue Restore Process.

      image from book
      Figure 14-6

    3. Select what to restore from the selected backup instance, for example, the complete farm, then click Continue Restore Process.

    4. Configure how to restore this data, for example do you want to use the same configuration, or do you want to define a new configuration, that is new web applications, databases, and service accounts? This is where you would enter a new SQL Server name, database names, and service accounts, If you have an image of the production environment in a virtual server, such as MS Virtual Server, then you can select Same Configuration, since the restore process will only overwrite the server in your virtual environment. Click OK to start the restore process.

  6. When the restore process is completed, open the temporary SharePoint server, locate the file to be restored, and move it using the steps listed earlier in the section "Moving and Copying Information" in this chapter.

image from book

All these examples describe how to restore a single document. Use the same steps when restoring single list items, or a single list or library.

Restoring a Single Site

When you want to restore a single site, you will follow almost the same steps as when restoring single items. The only difference is that you can restore items directly to the production server, if you have made a backup of individual sites using STSADM and its export operation. If not, you must restore the site to a temporary storage location and then move it. All scenarios are described below.

For example, say that you accidentally deleted the subsite Projects in the IT site collection; its URL was http://srv1/sites/it/projects. You must now restore that site, including all its content. Depending on what type of backup you have available, you will follow different steps, as listed below.

Try It Out Restore a Single Site Using the STSADM Import Method

image from book
  1. Locate the backup file for the site, in this example C:\Bkup\projects.bak.

  2. Open a command prompt window, and enter the following command:

         Stsadm --o import -url http://srv1/sites/it/projects -filename C:\bkup\projects.bak 

  3. Open the restored site with a web browser; make sure to manually update all security settings. The site is now restored and ready to be used.

image from book

If you only have backup of site collections, you cannot restore a single site, since the backup contains a complete site collection. In this case, you must first create a temporary site collection, then use STSADM export method to back up the site to be restored, and finally use the method above.

Try It Out Restore a Single Site Using STSADM Backups

image from book
  1. Find the latest backup set containing the site to be restored. In this example this site is stored in the backup for the site collection IT: C:\Bkup\it.bak.

  2. As described before, a site collection needs a new content database before it can be restored. If you have not done so before, open a command prompt and enter the following command. This will create a content database and associate it with the site collection http://srv1/sites/restore.

         STSADM.exe -o createsiteinnewdb -url "http://srv1/sites/Restore" -ownerlogin↩     "contoso\administrator" -owneremail administrator@contoso.com 

  3. You now have a content database for restoring any site collection to the URL address above. Next step is to run the restore procedure: Open a command prompt and type (on one line):

         STSADM --o restore -url http://srv1/sites/restore -filename↩     c:\bkup\it.bak -overwrite 

  4. The temporary site collection is now active and has the exact same settings as the original site collection. The next step is to make a backup of the single site to be restored. Open a command prompt and type:

         STSADM --o export --url http://srv1/sites/restore/projects -filename↩     c:\bkup\projects.bak 

  5. Now you have a backup of the single site Projects. Follow the steps for restoring a single site using an STSADM import operation to copy it back to the production environment.

image from book

Finally, if all you have is a backup made by SharePoint Central Administration, you need to follow a similar procedure to the last example. First, restore the backup to a temporary SharePoint server, next make a backup with STSADM's export operation of the single site to be restored, and then restore that site to the production environment, as shown in the following Try It Out.

Try It Out Restore a Single Site Using Central Administration Backups

image from book
  1. Find a temporary server that you can use as a temporary SharePoint server. Note that you can use MS Virtual PC or VM-Ware when creating this server; it does not have to be a physical server. In this example, the server is named restore-srv.

  2. Install the same SharePoint release, including service packs, as the production server. You can use a local SQL server in this temporary environment, regardless of how the production server is configured. Make sure to apply the same MS SQL Server service pack as in the production environment.

  3. Locate the latest backup files, in this example in \\srv2\Bkup.

  4. Start SharePoint Central Administration, and switch to the Operations page, then select the link Restore from backup, in the Backup and Restore section.

  5. The restore process consists of four steps:

    1. Enter the backup location; for example, \\srv2\bkup. Click OK.

    2. You will see a list of all previous backup instances stored in that backup location; select the backup instance, and click Continue Restore Process.

    3. Select what to restore from the selected backup instance, for example, the complete farm, then click Continue Restore Process.

    4. In the final step, you configure how to restore the data; for example, do you want to use the same configuration, or do you want to define a new configuration (i.e., new web applications, databases, and service accounts) ?This is where you would enter a new SQL Server name, database names, and service accounts. If you have an image of the production environment in a virtual server, such as MS Virtual Server, then you can select Same Configuration, since the restore process will only overwrite the server in your virtual environment. Click OK to start the restore process.

  6. When the restore process is completed, open the temporary SharePoint server. Locate the file to be restored, and move it using the steps listed earlier in the section "Moving and Copying Information" in this chapter.

  7. Open a command prompt and run the following command to make a backup of the site to be restored:

         STSADM --o export --url http://restore-srv/sites/it/projects -filename↩     c:\bkup\projects.bak 

  8. Now you have a backup of the single site Projects. Follow the steps described earlier for restoring a single site using an STSADM import operation to copy it back to the production environment.

image from book

Restoring a Single Site Collection

If you have to restore a complete site collection, you will need a backup made by STSADM or SharePoint Central Administration's backup process. For example, say that you accidentally delete the complete site collection http://srv1/sites/it. You must now restore it. Depending on what type of backup files you have available, you will follow one of these procedures.

Try It Out Recover a Site Collection Using STSADM

image from book
  1. Find the latest backup set containing the site to be restored. In this example, this site is stored in the backup for the site collection IT: C:\Bkup\it.bak.

  2. Since you need to restore the complete site collection, you can do this directly on the production server. Open a command prompt and enter:

         STSADM --o restore -url http://srv1/sites/it -filename c:\bkup\it.bak -overwrite 

image from book

That was simple, since the backup set contained exactly what you needed to restore. If you only have a backup made with SharePoint Central Administration, you first need to restore to a temporary server and then make a backup of that site collection, and finally restore that site collection to the production server.

Try It Out Recover a Site Collection Using MOSSBACKUP

image from book
  1. Find a server that you can use as a temporary SharePoint server. Note that you can use MS Virtual PC or VM-Ware when creating this server; it does not have to be a physical server. In this example the server is named restore-srv.

  2. Install the same SharePoint release, including service packs, as on the production server. You can use a local SQL server in this temporary environment, regardless of how the production server is configured. Make sure to install the MS SQL Server Client Tools and apply the same MS SQL Server service packs as in the production environment.

  3. Locate the latest backup files, in this example in C:\Bkup.

  4. Start SharePoint Central Administration, and switch to the Operations page, then select the link Restore from backup, in the Backup and Restore section.

  5. The restore process consists of four steps:

    1. Enter the backup location; for example, \\srv2\bkup. Click OK.

    2. You will see a list of all previous backup instances stored in that backup location; select the backup instance, and click Continue Restore Process.

    3. Select what to restore from the selected backup instance; for example, the complete farm, and then click Continue Restore Process.

    4. Configure how to restore this data; for example, do you want to use the same configuration, or do you want to define a new configuration (i.e., new web applications, databases, and service accounts. This is where you would enter a new SQL Server name, database names, and service accounts). If you have an image of the production environment in a virtual server, such as MS Virtual Server, then you can select Same Configuration, since the restore process will only overwrite the server in your virtual environment. Click OK to start the restore process.

  6. When the restore process is completed, open the temporary SharePoint server, and locate the site collection to be restored. Then open a command prompt and run the following command to make a backup of the site to be restored:

         STSADM --o backup --url http://restore-srv/sites/it/ -filename c:\bkup\it.bak 

  7. Now you have a backup of the site collection IT. Since you need to restore a complete site collection, you can do this directly on the production server. Open a command prompt, and enter:

         STSADM --o restore -url http://srv1/sites/it -filename c:\bkup\it.bak -overwrite 

image from book

Restoring a Complete Portal Server

The final scenario is when you have lost a complete MOSS portal site and need to get it back fast. This requires that you have a backup set of the complete farm made by SharePoint Central Administration. Using other tools such as the MS SQL Server backup utility or third-party backup solutions for SharePoint will also do, and they are described later on in this chapter.

For example, say that you have a portal with the URL http://srv1. It contains a large number of site collections and subsites as well. Something happens, and the portal gets corrupted beyond repair. Now, you must restore the complete SharePoint environment. Luckily, you have a full backup made with SharePoint Central Administration last night; now restore the farm by following the steps in the Try It Out below.

Try It Out Restore a Complete SharePoint Environment Using MOSSBACKUP

image from book
  1. Install the same SharePoint release, including service packs, on the same server. Make sure to install the MS SQL Server Client Tools and apply the same MS SQL Server service packs as in the production environment.

  2. Locate the latest backup files, in this example in \\srv2\Bkup.

  3. Start SharePoint Central Administration and switch to the Operations page, then select the link Restore from backup in the Backup and Restore section.

  4. The restore process consists of four steps:

    1. Enter the backup location; for example, \\srv2\bkup. Click OK.

    2. You will see a list of all previous backup instances stored in that backup location; select the backup instance, and click Continue Restore Process.

    3. Select the option to restore the complete farm, then click Continue Restore Process.

    4. Select the option Same Configuration. Click OK to start the restore process. Note that this process may take many hours, or even days, to complete, depending on the volume of data to be restored. As a general rule, it takes about 4 to 5 times longer to perform a restore than to make a backup.

  5. Open the restored portal server and make sure that it works.

image from book

Making a Backup Plan

A backup plan is very important and something you should make before using SharePoint in a production environment. Exactly how this plan should look varies, depending on a lot of parameters, such as:

  • q What SharePoint edition are you using - WSS alone or MOSS including WSS?

  • q How important is the data stored in SharePoint?

  • q What sites will be most important to protect?

  • q How often are the sites updated?

The description you get here is just general guidelines that you can follow to make your own backup plan. And remember the initial statement in this chapter. If you don't regularly verify that the backups are working, you cannot be sure that your backup plan is working. It is very important that you run fire drills now and then, to see that you actually can restore data. I suggest that you do a test every month and verify that you and your fellow SharePoint administrators can do a restore of:

  • q A single document

  • q A single site

  • q A site collection

  • q The complete portal environment (if you are running MOSS)

Use the following guidelines to write your own backup plan:

  1. Document your SharePoint environment, including:

    1. The name of the SharePoint Server(s).

    2. The name of the MS SQL server.

    3. The URL for the SharePoint environment.

    4. The IIS Settings, i.e.virtual server and application pool settings.

    5. The Search and Index Settings (if using MOSS).

    6. The Audience groups (if using MOSS).

    7. Any customization of the User Profile settings (if using MOSS).

    8. The security settings for the portal site areas (if using MOSS).

    9. All customization of portal sites (if using MOSS).

    10. A list of all web applications, site collections, and their owners.

    11. Any nondefault configuration settings of SharePoint.

    12. A list of all added Web Parts, including where you found them.

    13. A description of all modified SharePoint files, such as ASPX, CSS, and XML files.

  2. Decide if and when to run the STSADM export operation to protect important sites (like your boss's site) to make it very easy and fast to restore single sites and single items.

  3. Decide if and when to run STSADM to make it easier to restore site collections, sites and single items.

  4. Decide how often to run a full backup using SharePoint Central Administration.

  5. Decide where to store the backup files, if you should overwrite them every time, or what to do with them.

  6. Decide how often to run a file backup on the SharePoint server, including a System State backup that also covers the IIS Metabase. This will make it possible to recover from a complete disk crash.

  7. Document the restore procedures and who is responsible, including their contact information.

  8. Document the fire drills: what to test, how often, and by whom.

I am sure you can think of more things to describe in this backup plan. Just remember that this is a "living" document; it needs to be constantly updated. For example, when you add new Web Part, change any configuration settings, or create new site collections. The perfect place to store this backup plan is, of course, in SharePoint, but this is not a good idea, since you will need it in case of a SharePoint disaster. Make sure to have not one but at least two copies of this backup plan in different locations in case of fire, flooding, or similar disasters.



Beginning SharePoint 2007 Administration. Windows SharePoint Services 3 and Microsoft Office SharePoint Server 2007
Software Testing Fundamentals: Methods and Metrics
ISBN: 047143020X
EAN: 2147483647
Year: 2004
Pages: 119

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net