Today I started having problems with a backup source. Unfortunately the drive was failing and I needed to get the data off the device and onto another to prevent any further issues. As I’m using DPM 2012 sp1 for my backups I’m able to use the Powershell module to run some clever commands to move the data to a new source. So here is what I did.
First I loaded the DPM Management Shell.
It loads up like this.
Now I needed to set the the command ‘$disk’ to hold information about my data sources. To do this I ran the following command.
$disk = Get-DPMDisk -DPMServerName NameOfServer
NameOfServer is where you would enter the name of your DPM 2012 server.
After I ran the command $disk to check the result. As shown above.
Each disk data source can be referenced individually by using the command $disk[n]. n is the number of the disk from the list shown by using the command $disk. Where 0 (zero) is the top disk and the next one down is 1 etc. The image above shows my two disks referenced individually.
The next thing I did was to find my Protection Groups and allocate them to the command $pg. I did this as I only wanted to move some of my data and not all of it. I also wanted control over when each Protection Group’s data was being transferred. To do this I ran the following command.
$pg = Get-ProtectionGroup NameOfServer
NameOfServer as before is your server which has DPM 2012 running on it.
Again I ran $pg to see the result. As you can see from screenshot I have 3 Protection Groups. As with the $disk command above you can run $pg[n] this will allow you to individually show or reference each protection group. Remember the top one in the list is 0 (zero).
Now I have the the Protection Groups in the command $pg I can now allocate some data sources to the command $ds. By doing this it allows me to have full control over each data source and when and where it is being moved to. The command to run for this is as follows.
$ds = Get-Datasource $pg[n]
Again n is the reference to which Protection Group you wish to get the data sources from.
Again running $ds will display the data sources and running $ds[n] will allow you to reference the individual data sources.
Ok now I have everything referenced, I can run the commands to start the data migration. To run a migration I ran the following set of commands.
./MigrateDatasourceDataFromDPM.ps1 -DPMServerName NameOfServer -Source $ds[n] -Destination $disk[n]
NameOfServer as above is the server which your DPM 2012 is installed to and n is the number of the source.
This command may take a while to execute depending on the Datasource. It’s also worth noting you can transfer whole disk to disk or protection group to disk. Just change the the bit after source. I prefer to do it this way as it gives me more control.
As everything went ok I can now look at jobs in progress in DPM management console and see that a post recovery operation is in progress for the Datasource I have moved. After this job has finished a verification job may occur to keep data consistent.
Something worth noting here is that the data will not disappear from the old disk source until the allotted retention range has passed. So if the retention range is set to 5 days the data will remain on the old disk source until 5 days has passed. You can speed up this process by change the retention range to 1 day.
More Information on the process can be found on Technet using this link.
I hope you’ve found this useful. Please share and follow.