4 min. Read

Tapes have been a secure archival medium for many years, and are likely to continue to be used for this purpose for many years. There are many reasons why companies continue to use tapes against clouds for long-term protection, such as regulatory compliance and security, addressing backup latency issues, or just not being willing to transfer data to the cloud.

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

In this quick blog post, I’ll show you how to copy a restore point from disk to tape for long-term storage. This scenario is useful if you only add a tape library to DPM and want to copy the old restore point from disk, or for some reason the tape library failed and the long backup job did not end, in which case you can manually back up the tape when the tape library is online again.

With System Center Data Protection Manager, you can copy data to tape using the DPM Administrator Console by navigating Recovery workspace, and then select Copy to tape option in the next screenshot.

Next, you can select the tape library and tape options by selecting whether or not to compress the data on the tape.

How to copy DPM restore points to tape with #PowerShell #SCDPM 2

Now, if you want to copy a large number of restore points to tape, the interface is not the best option. Fortunately, we can automate this process in PowerShell.

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

To connect to the DPM server, run the following command:

Connect-DPMServer -DPMServerName $env:COMPUTERNAME

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

$Library = Get-DPMLibrary

In this example, I only have one tape library.

How to copy DPM restore points to tape with #PowerShell #SCDPM 3

Query all security groups and save the results in a variable. You will see their names Name column and Method of protection, you can see if this is a short-term storage disk or, in this case, our SQL protection group, using tape for long-term storage.

$PGroup = Get-DPMProtectionGroup

How to copy DPM restore points to tape with #PowerShell #SCDPM 4

This is a collection of objects. There is one object in this collection based on what we see. Remember that in PowerShell syntax, you can only type $ PGroup, and to include square brackets, [0], which refers to the first object in the collection, which in this case is an SQL security group object. Now, if you want to drill deeper into the security group and look for restore points, you can still do so. For example, I create a new variable named $ PObjects, equal to Get-DPMDatasource; So I use another cmdlet followed by a parameter -Protection group. I will refer to the previous variable, $ PGroup, and I’m interested in the SQL security group. You can make this reference in this case with square brackets: in this example it is [0]. The size of the syntax looks like this:

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

How to copy DPM restore points to tape with #PowerShell #SCDPM 5

The next thing I will do is see which restore points are available for this security group on disk. Again, this is a collection of objects. There were four objects in the collection based on what we see. In this example, I am interested in copying DPMDB_SCDPM2016 record, so I set [0] in square brackets; this refers to the first object in the collection. Finally, I save the results to a new variable. The whole syntax looks like this:

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

How to copy DPM restore points to tape with #PowerShell #SCDPM 6

Last but not least, I am going to choose which restore point I want to copy to tape. Again, this is a collection of objects. The disc has 9 restore points based on what we see. In this example, I am interested in copying the oldest restore point, so I will add [0] in square brackets; this refers to the first object in the collection. Finally, I use Copy-DPMTapeData cmdlet and select a restore point, including Tape library and Tape options. The whole syntax looks like this:

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

How to copy DPM restore points to tape with #PowerShell #SCDPM 7

Now this function may take some time depending on the amount of data to be copied. You can also track the progress of the work in the DPM console Tracking workspace. When the job is done, you can move on Management workspace below Libraries, you will notice that the restore point of the disc will be copied to the tape according to the following screenshot.

How to copy DPM restore points to tape with #PowerShell #SCDPM 8

That’s what you have!

Here is a complete PowerShell script that you can use to automate this process. In this example, I will select a specific restore point that was taken earlier 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

Note that the same steps above apply whether you use physical tapes or a virtual tape library, also known as VTL, which can be hardware or software that you install on a backup server.

Good privacy!

Want to know more about System Center Data Protection Manager and how to create a hybrid cloud service solution? Check out my recently published book: Microsoft System Center Data Protection Manager Cookbook.

With this book on your side (over 450 pages) you will learn the world of backup 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.

__
Thanks for locking my blog.

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

-Charbel Nemnom-

LEAVE A REPLY

Please enter your comment!
Please enter your name here