Freigeben über


How to Use The Migratedatasourcedatafromdpm.Ps1 DPM Powershell Script to Move Data

The Migratedatasourcedatafromdpm.Ps1 DPM Powershell Script is Included in Service Pack 1 of Data Protection Manager 2007.

The MigrateDatasourceDataFromDPM is a command-line script that lets you migrate DPM data for individual “data source(s)” or all Replica volumes and recovery point volumes to different physical disks. Such a migration might be necessary when your disk is full and cannot be expanded, your disk is due for replacement, or disk errors show up.

Depending on how you have configured your environment, this could mean one of more of the following scenarios for moving data source data:

· DPM Physical disk to another DPM Physical disk

· DPM Data source to different DPM Physical disk

· DPM Data source to Custom volume.

The MigrateDatasourceDataFromDPM script moves all data for a data source or disk to the new volume or physical disk. After migration is complete, the original disk from where the data was migrated from is not chosen for hosting any NEW backups, however the recovery points located on the source disk can be used for restores until the recovery points are expired.

Note: You must retain your old disks until all recovery points on them expire. After the recovery points expire, DPM automatically de-allocates the replicas and recovery point volumes on these disks.

All backup schedules continue to apply and protection of the data source continues as before, but will use the new disk.

After migrating the replica of a data source that has secondary protection enabled, you must start the Modify Protection Group wizard on the secondary DPM server, select the same data source, and complete the wizard. This reconfigures secondary backups to run from the new replica volume on the primary DPM server.

I will walk you through the steps on migrating data source (disk and data) to help you understand what the required commands and the results once the command has completed successfully.

In this first scenario we are going to use the MigrateDatasourceDataFromDPM to conduct a DPM disk to DPM disk migration from start to finish.

In the example below you can see in Disk Manager Disk 1 and Disk 2 is utilized for the DPM storage pool and the replica and recovery volumes are spread across both disks.

clip_image002

From within the DPM UI Protection Group Tab you will see that we have four protection groups with a number of different data sources (Share, SQL, Volume, etc.)

clip_image004

Within the DPM UI Management Tab under Disks you see that we have Disk 1 and Disk 2 allocated to the DPM storage pool

clip_image006

Now we have added two new physical disks to the DPM server which is running Data Protection Manager 2007 SP1, as you will note Disk 3 (4.88GB) and Disk 4 (146.48GB) are listed in Disk Manager and are unallocated and currently basic disks.

clip_image008

After walking through the process of adding Disk 4 as an additional disk to the DPM Storage Pool, you will see that it is now listed in the DPM UI and shows up as 100% unallocated space.

Adding Disks to the Storage Pool

https://technet.microsoft.com/en-us/library/bb795901.aspx

clip_image010

We will now open the DPM command shell and run a command (Get-DPMDisk -DPMServerName <DPM Server Name>) to display the disks.

Get-DPMDisk -DPMServerName RKW2K3-DPM

In order to use the migration powershell command you must use a variable name to hold the array of retured items. In the example below, we have used the variable $disk to hold the Get-DPMDisk -DPMServerName <DPM Server Name> output.

$disk = Get-DPMDisk -DPMServerName RKW2K3-DPM

After running the command you will notice that there are four disks listed, and they are not necessarily arranged in order that disk management lists them. Note that the NTDiskID is the physical disk number (zero based) that disk management lists in the GUI. Note that the NtDiskID are not in numeric order and that disk 0 (windows operating system disk) is not included in the output.

clip_image012

We are now going to use the MigrateDatasourceDataFromDPM.ps1 script to migrate the DPM Physical Disk 1 to Physical Disk 4. ( $disk array element [2] to array element [1] )

(./MigrateDatasourceDataFromDPM.ps1 -DPMServerName <DPM Server Name> -Source $disk[n] -Destination $disk[n])

When using this command the $disk[number] that is used within the brackets is not the NTDiskId but the is the element number in the array list in the $disk variable. This number is always zero based, meaning the 1st element in $disk[0] is physical disk 3 in the above screenshot.

Looking at the output when running the command $disk “DPM Physical Disk 1 is third element in the list starting with 0 this will make Physical Disk 1 = [2] in the list and Physical Disk 4 = [1] in the list so our command will be as follows;

./MigrateDatasourceDataFromDPM.ps1 -DPMServerName RKW2K3-DPM -Source $disk[2] -Destination $disk[1]

clip_image013

The command may take some time depending on the number and size of the volumes on the source disk and once completed you will be back at the DPM Shell prompt.

clip_image015

You will now notice in Disk Management the DPM replica and recovery point volume information which is location on Disk 1 and Disk 2 has been migrated to Disk 4. Any new recovery points for the respective data source will now be located on the new volumes on the new disk, the original volume data on Disk 1 and Disk 2 will still need to be maintained until the recovery point on them expire. Once all recovery points expire on the old disk(s), they will appear as all unallocated free space in disk management, and can then be removed from Windows or be reused.

The MigrateDatasourceDataFromDPM script moves all data for a data source or disk to the new disk or volume. After migration is complete, the original disk from where the data was migrated is not chosen for hosting any new backups. You must retain your old disks until all recovery points on them expire. After the recovery points expire, DPM automatically de-allocates the replicas and recovery point volumes on these disks.

clip_image017

Also since we did a disk migration of Disk 1 to Disk 4, Disk 1 no longer shows up in the DPM UI and will not be used any further for DPM Storage Pool this is normal and is as expected.

clip_image019

After completing the disk to disk migration you will also notice that all of the Protection Groups which used Physical Disk 1 for either or both volumes (replica and Recovery Point) will now show up in DPM as Replica is inconsistent. This is normal and is expected as there has been changes made to the volume and will need to be re-synchronized by running a synchronization job with consistency.

clip_image021

After we have completed the Synchronization job with consistency, all of the Protection groups are now all consistent and up to date and have a Protection Status of OK.

That concludes the Disk to Disk migration, in my next blog we will walk through the process of conducting a Data Source to Disk migration and see how this will help in minimizing the amount of volumes a data source uses.

 

 

Author:
Robert Kierzek
Senior Support Engineer
Microsoft Corporation

 

Technorati Tags: DPM,Data Protection Manager 2007

Comments

  • Anonymous
    January 01, 2003
    Hello,when are you going to publish your next blog about minimizing the amount of volumes a data source uses. I have to reduce the size of the volumes in DPM. I backup Exchange and half of the volume of DPM are empty. I want to move this volume and minimize the sie of the volume. How can I do it?regardsBlaise
  • Anonymous
    January 01, 2003
    Can this be used to move data onto a volume that is already in use?
  • Anonymous
    January 01, 2003
    while using the array index on $disk works, it relies on you correctly identifying the disk in the array. Tidier to use $source = get-dpmdisk | where {$.ntdiskid -eq 2}. Similarly, I would then set $dest = get-dpmdisk | where {3,4 -contains $.ntdiskid} (note that I can specify all the disks in my new storage pool). Migration command would then be ./MigrateDatasourceDataFromDPM.ps1 -DPMServerName RKW2K3-DPM -Source $source -Destination $dest
  • Anonymous
    June 24, 2010
    Same question as Mike, we have 2 volumes we want to move to one volume, can this be done with this method?Cheers.
  • Anonymous
    September 21, 2010
    Can this be used to move data onto a volume that is already in use? I know this has been asked before.
  • Anonymous
    September 23, 2010
    How do you migrate from one protection group to another or can this not be done?
  • Anonymous
    February 11, 2011
    Does anyone know the answer to the question that has already been asked?  I need help too.  "Can this be used to move data onto a volume that is already in use?"
  • Anonymous
    April 05, 2011
    When are you going to post the next blog....."in my next blog we will walk through the process of conducting a Data Source to Disk migration" ????????????????????????
  • Anonymous
    April 05, 2011
    Yeah...I want to know how to do Data Source to Disk migration, too!!!  Please post the next blog!!
  • Anonymous
    May 04, 2011
    I also want to move data from 1 storage pool disk to another storage pool disk, both of which currently h ave DPM volumes on them.
  • Anonymous
    June 12, 2011
    The comment has been removed
  • Anonymous
    March 06, 2012
    The comment has been removed
  • Anonymous
    May 14, 2012
    Dear Robert,I my senario I have migrated all protection groups to the new disk pool but I could not retain old disk till the retention range over. now I am getting LDM database occupancy error when i try to create new protection group
  • Anonymous
    June 02, 2012
    Such a migration might be necessary when your disk is full and cannot be expanded, your disk is due for replacement, or disk errors show up.  <a href="http://www.rattan-lounge-moebel.ch">lounge gartenmöbel</a>
  • Anonymous
    December 11, 2012
    The comment has been removed
  • Anonymous
    December 11, 2012
    This is a really great explanation, the only thing I would expound on is making sure when you use./MigrateDatasourceDataFromDPM.ps1 -DPMServerName RKW2K3-DPM -Source $disk[2] -Destination $disk[1]That you understand on this part "$disk[2]" the "2" refers to disk number 2 in the list starting with 0. The disk number is based on counting from the top of the list starting with 0.Don't let the "NtDiskId" catch you up. Count down the list starting with 0 to identify them.My thick skull made this hard. It's explained in the instructions above but I assumed instead of comprehended.
  • Anonymous
    January 02, 2013
    One Note...This will not migrate any datasources that have inaactive protected data.  It will move any active datasources and leave the inactive datasourcs.  The disks will still show in the DPM console as well.