Moving Multiple Databases from same Protection Group to New Disk via script (DPM2016-UR4) RRS feed

  • Question

  • Hello! I am trying to move an entire protection group that only protects one database server from one storage disk to another.  I used the following script and made an foreach loop in hopes it would move everything.  After I run the script it seems to complete successfully but when I check the specific database it has not moved. 

    Am I doing something wrong? or is this a defect?

    $pg = Get-DPMProtectionGroup | sort
    $mpg = Get-DPMModifiableProtectionGroup $pg[14]
    $ds = Get-DPMDatasource $mpg
    $vols = Get-DPMDiskStorage -Volumes | sort -Property AccessPath
    Foreach($X in $ds){
    $mpg = Get-DPMModifiableProtectionGroup $pg[14]
    Set-DPMDatasourceDiskAllocation -ProtectionGroup $mpg -Datasource $X -TargetStorage $vols[1] -MigrateDatasourceDataFromDPM -Verbose
    Set-ProtectionGroup $mpg -Verbose

    I am using DPM2016-UR4 on Server 2016 - all database servers are 2016 with sql 2014 sp1+. 

    Thank you for the help!

    Wednesday, April 25, 2018 2:01 PM


  • housekeeping - closing old post.

    I believe the below should accomplish what you want.

    $PG = get-dpmprotectiongroup
    $MPG = get-dpmmodifiableprotectiongroup $PG[14]
    $DS = get-dpmdatasource $MPG
    $Vol = get-dpmdiskstorage -Volumes
    $DS | foreach {set-dpmdatasourcediskallocation -protectiongroup $MPG -datasource $_ -targetstorage $Vol[1] -migratedatasourcedatafromdpm -verbose}
    set-protectiongroup $MPG -verbose

    Mike Jacquet

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, January 3, 2020 11:09 PM