Tuesday, June 22, 2010

SharePoint 2010 Granular Backup and Restore - Recovering Data from an Unattached Content Database

he built-in backup tool in SharePoint 2010 accommodates backing up the following:

• Back up a farm
• Back up a farm configuration
• Copy configuration settings from one farm to another
• Back up a Web application
• Back up a service application
• Back up search
• Back up the Secure Store service
• Back up a content database
• Back up databases to snapshots
• Back up customizations
• Back up a site collection
• Export a site, list, or document library
• Back up or archive logs

See here for more detail: http://technet.microsoft.com/en-us/library/ee428315.aspx

Sounds pretty good right? What if you have a user who deleted a list, library or even an individual document? If it's not sitting in the recycle bin for the site collection, then what?

The answer is a new feature called granular restore which gives you one more option to use before you have to go to an expensive third party backup and restore solution. The only catch is that you have to have a SQL backup of the content database in question that you can mount in SQL using SQL Management Studio. To be safe, I use the built-in SharePoint 2010 backup tool to run farm backups (How to Automate SharePoint 2010 Farm Backups), but I also do regular SQL backups. In the event of some type of disaster, I've given myself a few options for doing a restore.

Step 1

In SQL highlight the content database you want to restore, right-click it and select Tasks - Restore -Database. In the "To Database" field, type a name for the new database (ex: DatabaseName_restore). Specify the point in time you want to do the restore from.

Step 2

Go into Central Admin on the SharePoint server and select Backup and Restore - Recover data from an unattached content database. Specify the SQL server and database name you created above during the restore. Select Browse Content and hit next.

Step 3

Select the site collection, site, and list or library you want to restore. Specify that you want to export the selected content, and specify a location for the file. I find the best way to locate the library, list, etc that I want to restore is to use the Search field that's presented to you.
When you hit Next, you'll be prompted for the location you want to export the site to. I just use a local folder. Next, hit Start Export.
Step 4

Now that you exported the data from the restored database, you can import the data into the production site to restore the missing list, library, document, etc.

Open SharePoint PowerShell while logged in as Farm Admin and run the Import-SPWeb command to specify the identity of the web you're working with, and the path to the restore file you created above:

Note that you specify the root web, and it will restore the data you specified when you browsed the restored database to its original location. To learn more about what options are available when importing data visit http://technet.microsoft.com/en-us/library/ff607613.aspx.

Wednesday, June 16, 2010

New Look for Imperfect IT!!!

I recently changed the template used for my blog. Let me know what you think of the look and the layout. I found the old layout was a little cramped.


Wednesday, June 9, 2010

SharePoint Manager 2010

Although SharePoint 2010 offers the Central Administration Site and PowerShell as methods to expose current settings in your SharePoint environment, they can often be a little clunky to work with.

If you've never seen it, you're going to love SharePoint Manager 2010. It's a free download from codeplex. As the description for the tool states, "SharePoint Manager 2010 is a SharePoint object model explorer. It enables you to browse every site on the local farm and view every property. It also enables you to change the properties".

To get your very own copy for free, simply visit http://spm.codeplex.com/.

I first stumbled on this tool when I was going through application event logs on my SharePoint 2010 server and couldn't figure out what site certain errors were referring to. As many of you know event logs simply use the ID of a site (ex: 0a90494e-c226-4067-9762-7d75f952c803). A simple Google search for linking ID's to names turned up SPM 2010. Now I can simply drill down to my Site Collections with the tool and it's easy to see:

The tool is also very handy for finding all your application pool and IIS settings, not to mention having a look at what's in a sites recycle bin. You can also look at quota settings, as well as what features or services are deployed. Curious to know who has permissions on a site or what lists are in a site? Just drill down and the information is there!

Some additional points:
  • The application has to be installed on the SharePoint Server you want to work with.
  • You have to be logged in as a SharePoint administrator.
  • The tool has multilingual support. 
  • It uses the SharePoint object model and doesn't access SQL directly.
  • It was architected and designed by Carsten Keutman - http://www.keutmann.dk/. Thanks Carsten!
Download it today and let me know what you think. If you know of any other tools other admins might be interested in, pleas let me know.

Tuesday, June 1, 2010

SharePoint 2010 Farm Backup Fails

I was successfully running backups of my SharePoint 2010 server for a few weeks, then all of a sudden I noticed they weren't finishing properly. They'd run through most of the backup process, then stall trying to backup the Search Service Application. When I looked at the backup log file it showed the following:

I also noticed the following event log error (Event ID: 67, Source: SharePoint Server Search) :

After some investigation, I realized I had deleted my original Search Application and created a new one, but for some reason the old object still existed in SQL.

I tried a few methods to delete the old object, but nothing was working. When I manually tried to delete it through Central Admin it would pop up a screen saying it was processing, but it never did anything. A Google search turned up the following article: http://prequest01.wordpress.com/2008/08/16/unable-to-delete-shared-services/

I used the following stsadm command:

Stsadm -o deleteconfigurationobject -id “object GUID

To find the object GUID, simply go into Central Admin - Manage Service Applications and highlight the offending legacy service application (Search Service Application in my case). You should now be able to see the GUID in the IE address bar. Run the command above, and try your backups again and all should be well.

You can also run the following command from the SharePoint PowerShell: Get-SPServiceApplication

If your backups are still failing, you can always increase the logging level to get more details about the Backup and Restore Process in the Diagnostics Logging Settings, from Errors only to Verbose. This will help troubleshooting. Once you find out the exact issue, you can bring logging back to default levels to reduce I/O and storage required for this extra activity.