How To Copy DPM Recovery Points To Tape With #PowerShell #SCDPM

5 min read

Introduction

Tapes have been the definite archive media for many years and will probably continue to be used for this purpose for many years to come. There are many reasons why companies are still using tapes versus cloud for long-term protection, things like meeting regulatory compliance requirements and security, accommodating backup latency issues, or they are just not ready to move data to the cloud.

The protected data by SCDPM can be backed-up to disks for short-term retention, to tapes for short-term and long-term retention, and to Microsoft Azure for long-term retention.

In this quick blog post, I will show you how to copy a recovery point from disk to tape for long-term retention. This scenario is useful if you just add a tape library to DPM and you want to copy an old recovery point from disk, or for some reasons your tape library failed, and the long-term backup job did not complete, in this case, you can manually copy your backup to tape after your tape library is back online.

Copy DPM Recovery Points To Tape With PowerShell

With System Center Data Protection Manager, you can copy your data to tape using DPM Administrator Console by going to the Recovery workspace, then select Copy to tape option as shown in the following screenshot.

Next, you can select the tape library and tape options by choosing whether to compress, encrypt or do not compress your data on tape.

Now if you want to copy a large number of recovery points to tape, then the UI is not your best option. Luckily, we can automate this process in PowerShell.

Open the Windows PowerShell session on your DPM server and take the following steps:

Connect to the DPM server by running the following command:

Connect-DPMServer -DPMServerName $env:COMPUTERNAME

Then query all your tape libraries attached to DPM by running the following command:

$Library = Get-DPMLibrary

In this example, I have only one tape library.

Query all protection groups and store the results in a variable. You can see their name under the Name column, and, under ProtectionMethod, you can see whether it’s short-term storage using disk, or, in this case of our SQL protection group, using tape for long-term retention.

$PGroup = Get-DPMProtectionGroup

This is an object collection. There is one object in this collection based on what we’re seeing. Bear in mind, in PowerShell syntax, what you could do is type in $PGroup, and if you were to incorporate square brackets, [0], that would refer to the first object in the collection, which, in this case, is the SQL protection group object. Now, if you want to drill deeper into that protection group and look for recovery points, what you could do is take that further. For example, I will create a new variable named $PObjects, equal to the result of Get-DPMDatasource; so, I will use a different cmdlet here, followed by the parameter -ProtectionGroup. I am going to refer to the previous variable, $PGroup, and I am interested in the SQL protection group. You can make that reference in this case with square brackets: in this example, it’s [0]. The full syntax will look like the following:

$PObjects = Get-DPMDatasource -ProtectionGroup $PGroup[0]

The next thing I am going to do is see what recovery points are available for that protection group on disk. Again, this is an object collection. There were four objects in this collection based on what we’re seeing. In this example, I am interested in copying DPMDB_SCDPM2016 to tape, so I insert [0] in square brackets; this would refer to the first object in the collection. Finally, I will store the results in a new variable. The full syntax will look like this:

$RPs = Get-DPMRecoveryPoint -Datasource $PObjects[0]

Last but not least, I am going to choose which recovery point I want to copy to tape. Again, this is an object collection. There are 9 recovery points on disk based on what we’re seeing. In this example, I am interested in copying the oldest recovery point, so I insert [0] in square brackets; this would refer to the first object in the collection. Finally, I will use the Copy-DPMTapeData cmdlet and select the recovery point including the Tape Library and the Tape Options. The full syntax will look like this:

Copy-DPMTapeData -RecoveryPoint $RPs[0] -SourceLibrary $Library[0] -TapeLabel "Copy DPM Disk Recovery Point To Tape" -TargetLibrary $Library[0] -TapeOption Compress

Now depending on the amount of data you are copying, this operation may take some time. You can also monitor the progress of the job from the DPM console under Monitoring workspace. When the job is completed, you can switch to the Management workspace under Libraries, you will see that the disk recovery point is copied to tape as shown in the next screenshot.

 

That’s it there you have it!

Here is the full PowerShell script that you can use to automate this process. In this example, I am selecting a specific recovery point which was taken at the beginning of this year.

Connect-DPMServer -DPMServerName $env:COMPUTERNAME

$Library = Get-DPMLibrary 

$PGroup = Get-DPMProtectionGroup 
$PObjects = Get-DPMDatasource -ProtectionGroup $PGroup[0]

$RPs = Get-DPMRecoveryPoint -Datasource $PObjects[0] | Where-Object {$_.BackupTime -match "01.01.2019"}

Copy-DPMTapeData -RecoveryPoint $RPs[0] -SourceLibrary $Library[0] -TapeLabel "Copy DPM Disk Recovery Point To Tape" -TargetLibrary $Library[0] -TapeOption Compress

Please note that the same steps above apply whether you are using physical tapes or virtual tape library, also known as VTL, which could be a hardware appliance or software that you install on your backup server.

Happy Data Protecting!

Learn more

Do you want to learn more about System Center Data Protection Manager and how to create a hybrid-cloud backup solution? Make sure to check my recently published book: Microsoft System Center Data Protection Manager Cookbook.

With this book (over 450 pages) on your side, you will master the world of backup with System Center Data Protection Manager and Microsoft Azure Backup Server deployment and management by learning tips, tricks, and best practices, especially when it comes to advanced-level tasks.

__
Thank you for reading my blog.

If you have any questions or feedback, please leave a comment.

-Charbel Nemnom-

About Charbel Nemnom 524 Articles
Charbel Nemnom is a Cloud Architect, ICT Security Expert and Microsoft Most Valuable Professional (MVP), totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 17 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize the performance of mission-critical enterprise systems. Excellent communicator is adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design, business continuity, and cloud security.

Be the first to comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.