Friday, January 24, 2014

Backup SharePoint 2013

After building 4 farms, I deployed powershell to backup each farm (full farm backup), I quickly ran out of disk space for backups (250GB) as the backup-spfarm command-let will not overwrite a pre-existing farm backup (spbr0000 directory), therefore, I only had enough disk to retain one backup of each environment.

Enter SharePoint Backup Augmentation Cmdlets from CodePlex (http://sharepointbac.codeplex.com).

SharePointBAC makes it possible to groom backup sets, archive backups, and more. While the version on codeplex supports 2010, I was able to obtain the 2013 source files from Trevor Seward, MVP.

Once the solution is added and deployed, the following 5 new command-lets become available:

  1. Get-SPBackupCatalog: Retrieves an SPBackupCatalog object for a selected backup location and exposes properties of the catalog
  2. Export-SPBackupCatalog: Generates an export/archive of one or backup sets that is compressed as a zip file by default
  3. Remove-SPBackupCatalog: Performs grooming (i.e., cleaning out old backups) on a backup catalog and its associated backup sets
  4. Send-SPBackupStatus: E-mails a summary of the last backup operation to selected recipients using the farm's outbound e-mail configuration
  5. Set-SPBackupCatalog: Updates properties on an SPBackupCatalog object (more specifically, its underlying spbrtoc.xml catalog file)
        Here is a sample .ps1 script utilizing SharePointBAC solution which will backup farm and retain only the most recent backup:

        Add-PSSnapin Microsoft.SharePoint.PowerShell
        $cat = Get-SPBackupCatalog \\server\Share
        Backup-SPFarm -Directory \\server\Share -BackupMethod Full
        $cat.Refresh()
        $cat | Remove-SPBackupCatalog -RetainCount 1 -Confirm:$false
        $cat.Refresh()
        $cat | Send-SPBackupStatus -Recipients "admin@domain.com"

        1 comment:

        1. Hi,
          SharePoint Online is used for business backup task and it can be activated using the Office 365 administrator credentials.Once the backup is activated, an initial backup is performed.CloudAlly provides unlimited archive retention and unlimited archive storage.
          Have a look.
          sharepoint backup

          ReplyDelete