Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts

Monday, May 7, 2012

New eBook for Automating SharePoint Backups with PowerShell

We've had a lot of requests for more details on how to setup automated SharePoint backups with PowerShell, so we've gone ahead and created a detailed ebook which outlines the steps and permissions you need to get your backups up and running. In addition to screen shots, there are also copies of the scripts we use as well as an email notification section that will let you know if your backups failed. Simply click on the Buy Now button below and you can pay with your Paypal account or credit card. At only $9.99 USD, it's thousands cheaper than a 3rd party solution and will let you sleep a little sounder at night. If you're not satisfied, we'll gladly refund your money!





Tuesday, September 21, 2010

DocAve Version 5 for SharePoint 2010

Up until recently I've been running my backups using the built in backup and recover tool and Powershell (see http://imperfectit.blogspot.com/2010/03/automate-sharepoint-2010-farm-backups.html), but my environment has started to grow and become more complex. That, and it's larger than the recommended 150 GB limit "suggested" by Microsoft. As a result I had to find a more robust data protection solution. After much testing I went with AvePoint's DocAve v5.

DocAve Backup and Recovery for SharePoint 2010 offers two types of backup and recovery: Granular and Platform


Granular Content and Data Protection

• Supports SharePoint 2010, Microsoft Office SharePoint Server (MOSS) 2007 and Windows SharePoint Services 3.0 environments (via DocAve v5), and SharePoint Portal Server 2003 and Windows SharePoint Services 2.0 (via DocAve 4.5). Support for SharePoint 2001 is available – please contact an AvePoint representative).

• Full fidelity backup and restore of all lists, libraries and items (including Events, Links, Tasks, Contacts, Announcements, Discussion Boards, Surveys, Issues, Custom Lists, Areas, Sub Areas, Portal Links, Workflow Definitions, Layout Templates, and Site Definitions, along with access permissions, metadata and version histories)

• Backs up and restores SharePoint workflow definitions

• Full fidelity item-level restore from DocAve, SQL native backups created by T-SQL script or a maintenance plan, DPM, IBM-TSM, HP Data Protector, as well as third-party embedded SQL backup engines, including HyperBac and LiteSpeed Engine

• Granular, item-level restore with sliding timeline view, along with full text keyword search and identification criteria mask search

• Restore content to different SharePoint instances or locations, including file systems and networked file shares with DocAve's "out-of-place restore" functionality

• Manual and Automated Data Pruning feature helps manage historic SharePoint backup data and improve access speed to more recent backups

• Data Coalescing feature allows collapsing incremental backups into one backup data set for easy retrieval.

• Item-level "out-of-place restore" for complete hardware failure

• Fast granular backup speeds, up to 60GB/hour

Comprehensive Platform Protection

• Backup and recover entire SharePoint farms or selective components including all servers and back-end SQL databases with all configurations, Index/Job servers, as well as front-end IIS settings and file system resources

• Quickly and selectively restore individual or a combination of farm components (content databases, web applications, SSP, etc.)

• Safeguard front-end web server resources (IIS settings, Template files, user selected resources, local file systems, etc.)

• Backup InfoPath form templates, Project Server content and Site Definitions

• Support for SharePoint Features

• Up-to-the-minute restore using SQL logs restoration

• Leverages Volume Shadow Copy Service (VSS) to ensure consistent point-in-time backups

• Fast platform backup speeds, up to 100 GB/hour

• Efficient data streaming via open standards, including VDI and VSS without staging location requirements

If you've worked with this product or others, I'd be interested to hear your opinions.

Thanks!

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.

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.



Friday, March 26, 2010

Automate SharePoint 2010 Farm Backups with Powershell

***Update (01/07/2013): We recently noticed that installing KB2506143 (Windows Management Framework 3.0) breaks the ability for SharePoint Powershell to run the backup. Uninstall it and the script should start working again.***

We've had a lot of requests for more details on how to setup automated SharePoint backups with PowerShell, so we've gone ahead and created a detailed ebook which outlines the steps and permissions you need to get your backups up and running. In addition to screen shots, there are also copies of the scripts we use as well as an email notification section that will let you know if your backups failed. Simply click on the Buy Now button below and you can pay with your Paypal account or credit card. At only $9.99 USD, it's thousands cheaper than a 3rd party solution and will let you sleep a little sounder at night. If you're not satisfied, we'll gladly refund your money! For the basic steps minus some of the more advanced funtionality, see below.


I recently built several server farms for our developers to work on. In order to make sure I could restore the farms to their original condition, I setup the following automated backup process. Below is a brief outline of the steps.

1. Create a folder on a local drive of the SharePoint 2010 server called backups (E:\backups). Share that folder as "backups" and give the account you used to install SharePoint as well as the farm and SQL database accounts full access (share permissions and NTFS).

2. Create a folder in E:\backups called Scripts. Inside there you create 4 files:

backupsharepointfarm.ps1 – This script will backup your entire farm to the share you created. This script will contain the following:

Add-PsSnapin Microsoft.SharePoint.Powershell
Backup-SPFarm -Directory \\ServerName\Backups -BackupMethod full

cleanbackups.ps1 – This script will check the spbrtoc.xml file and delete backups older than 7 days so you don’t run out of disk space. You can change $days value. This script will contain the following:

# Location of spbrtoc.xml
$spbrtoc = "E:\Backups\spbrtoc.xml"

# Days of backup that will be remaining after backup cleanup.
$days = 7

# Import the Sharepoint backup report xml file
[xml]$sp = gc $spbrtoc

# Find the old backups in spbrtoc.xml
$old = $sp.SPBackupRestoreHistory.SPHistoryObject |
? { $_.SPStartTime -lt ((get-date).adddays(-$days)) }
if ($old -eq $Null) { write-host "No reports of backups older than $days days found in spbrtoc.xml.`nspbrtoc.xml isn't changed and no files are removed.`n" ; break}

# Delete the old backups from the Sharepoint backup report xml file
$old | % { $sp.SPBackupRestoreHistory.RemoveChild($_) }

# Delete the physical folders in which the old backups were located
$old | % { Remove-Item $_.SPBackupDirectory -Recurse }

# Save the new Sharepoint backup report xml file
$sp.Save($spbrtoc)
Write-host "Backup(s) entries older than $days days are removed from spbrtoc.xml and harddisc."

Backup.bat – This is a simple batch file to run the above backupsharepointfarm.ps1 script. Create a scheduled task to run it every night. The file contains the following:

powershell -command E:\Backups\Script\BackupSharePointFarm.ps1

Clean.bat – This batch file will run the script to clean out older backup files (cleanbackup.ps1). The file contains the following:

powershell -command E:\Backups\Script\cleanbackups.ps1

3. Create a scheduled task that will run both of the .bat files you created and set them to run at night when no one’s around. You have to make sure the scheduled tasks are set to run with the SharePoint farm account. After a full week you’ll have a directory with 7 days worth of backups similar to the following:







Note: In order to run PowerShell commands on your server, you need to open powershell and execute the following command: Set-ExecutionPolicy Unrestricted

There are several factors involved in running a successful scripted backup which are covered by Todd Klindt in the following Microsoft SharePoint forum thread: http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/f755e7c1-bd0a-4c00-9be6-bbca83cf666b/.

1.Your Central Admin app pool account must have read/write access to the location of the backups.

2.Your SQL Service account must have read/write access to the location of the backups.

3.If you're running a farm backup from STSADM or Windows PowerShell, the account you're running it as must have read/write access to the location of the backups

4.The location must be accessible from the SharePoint machine the backup is running on.

5.The location must be accessible from the SQL instance that SharePoint is trying to back up.

6.This is why all the examples are UNCs, \\server\share, and not local paths, C:\backups

That’s about it. Give it a try and let me know if you have any problems. The file and share permissions are critical!