Mike Ratcliffe

Veeam Backup and Replication: Configuring custom synthetic full backups schedule instead of just default Monday-Sunday

When backing up large VMs and keeping a high number of restore points with Forever Incremental it is important to have the occasional full backup to minimize the time it takes to restore data. For the sake of speed, Synthetic full backups are the obvious choice. Unfortunately the Veeam Backup and Replication UI only allows you to configure Synthetic full backups as often as once a day or as little as once a week.

Synthetic4-300x300

For some, this may not present a problem, however if you are using Windows Deduplication and backing up large amounts of data, running Synthetic full backups once a week could result in a lot more data than Windows Deduplication can handle depending on resource availability.

As with most things, this can be solved using a PowerShell script.  Below is the PowerShell script I use to enable and disable synthetic full backups.  Ill step you through the script however if you prefer you can skip to the bottom for the complete script.

Because I am enabling and disabling Synthetic fulls, to avoid the need to have two different scripts (one to disable and one to enable), I create a parameter and use it in within a switch. Create a string based parameter in the start of the script like this. In this case the parameter is $option.

param(

[string]$option

)

Next add the VeeamPSSnapIn.

Add-PsSnapIn VeeamPSSnapIn

Now configure the switch options. In this example, there are three switch options -enable (where we will enable the synthetic full backups), disable (where we will disable synthetic full backups), and default (which, if enable or disable are not specified, just lets you know nothing was changed and you need to specify an option when running the script).

switch ($option)

   {

       enable {}

       disable {}

       default {}

   }

To enable/disable synthetic full backups, I use Get-VBRJob and pipe that to Set-VBRJobAdvancedBackupOptions.

The TransformFullToSyntethic is the “Create synthetic full backups periodically” and the TransformIncrementsToSyntethic is the “Transform previous backup chains into rollbacks” options you will see in the UI. Everything else is pretty straight forward. In this example, synthetic full backups are set for Sunday.

enable {

Get-VBRJob -name “Your Backup Job” | Set-VBRJobAdvancedBackupOptions -Algorithm Incremental -TransformFullToSyntethic $True -TransformIncrementsToSyntethic $False -TransformToSyntethicDays “Sunday”

}

Another variation would be making the change on the remote Veeam Backup and Replication server…

enable {

invoke-command -computername YourComputer -scriptblock {Add-PsSnapIn VeeamPSSnapIn;Get-VBRJob -name “Your Backup Job” | Set-VBRJobAdvancedBackupOptions -Algorithm Incremental -TransformFullToSyntethic $True -TransformIncrementsToSyntethic $False -TransformToSyntethicDays “Sunday”}

}

Also if you want to chain multiple jobs in any of these switch options just use ; at the end of each.

enable {

Get-VBRJob -name “Your Backup Job” | Set-VBRJobAdvancedBackupOptions -Algorithm Incremental -TransformFullToSyntethic $True -TransformIncrementsToSyntethic $False -TransformToSyntethicDays “Sunday”;

invoke-command -computername YourComputer -scriptblock {Add-PsSnapIn VeeamPSSnapIn;Get-VBRJob -name “Your Backup Job” | Set-VBRJobAdvancedBackupOptions -Algorithm Incremental -TransformFullToSyntethic $True -TransformIncrementsToSyntethic $False -TransformToSyntethicDays “Monday”}

}

On a side note, the synthetic full backup will run at the first incremental schedule of the day so you may want to add an additional incremental time to your schedule to accommodate this.

Now repeat for the disable switch changing the TransformFullToSyntethic to $false and give the default switch option a message.

Once the script is built, schedule it based on your desired needs. Below is an example of how to schedule it using the Windows Task Scheduler.

Action: Start a program

Program/Script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Add Arguments: -ExecutionPolicy Bypass -command “& ‘c:\scripts\SyntheticFulls\EnableDisableSynthetic.ps1′ ‘enable’”

Start in: C:\Scripts\SyntheticFulls

 

The complete script:

param(

[string]$option

)

Add-PsSnapIn VeeamPSSnapIn

switch ($option)

   {

       enable {Get-VBRJob -name “Your Backup Job” | Set-VBRJobAdvancedBackupOptions -Algorithm Incremental -TransformFullToSyntethic $True -TransformIncrementsToSyntethic $False -TransformToSyntethicDays “Sunday”}

       disable {Get-VBRJob -name “Your Backup Job ” | Set-VBRJobAdvancedBackupOptions -Algorithm Incremental -TransformFullToSyntethic $False -TransformIncrementsToSyntethic $False -TransformToSyntethicDays “Sunday”}

       default {“Nothing was changed because no option was specified. Specify either -option enable or -option disable”}

   }

Hope you found this information helpful.  I look forward to Veeam adding an option to do this in their UI in the future.

For more information about Veeam Backup and Replication visit https://www.veeam.com/vm-backup-recovery-replication-software.html

Leave a Reply