rubrikinc / rubrik-sdk-for-powershell

Rubrik Module for PowerShell
https://build.rubrik.com/sdks/powershell/
MIT License
102 stars 87 forks source link

Change Logical Name for new DB EXport #847

Closed nthoman closed 2 months ago

nthoman commented 7 months ago

Is your feature request related to a problem? Please describe.

I am trying Export and DB backup to a new DB with a new name on the same server using the Export-RubrikDatabase. This is for a new test environment refresh where we need to make a copy of a bunch of DBs at a certain point in time.

Describe the solution you'd like

Getting error WARNING: user_error WARNING: Logical name 'DB_PS' does not map to any of the backup files in the snapshot.

Describe alternatives you've considered

ForEach ($DB in $DBs){
    Write-Host "Getting Snapshots for:" $DB.Name -ForegroundColor Cyan
    $SnapShot = Get-RubrikSnapshot -id $DB.ID -Latest
    $Dest = Get-RubrikSQLInstance -Hostname $ServerName -Name $InstanceName
    $DestDBName = $DB.Name + "_PS"
    $DestDBLog = $DestDBName +"_LOG"
    $targetfiles = @()
    $targetfiles += @{logicalName=$DestDBName ;exportPath='G:\Data\'}
    $targetfiles += @{logicalName=$DestDBLog;exportPath='G:\Data\'}

    Write-Host "Exporting Snapshot:" $SnapShot.date "To:" $Dest.ID -ForegroundColor Cyan
    Export-RubrikDatabase -Id $DB.ID -RecoveryDateTime $SnapShot.date -TargetInstanceId $Dest.ID -TargetDatabaseName $DestDBName -TargetFilePaths $targetfiles -FinishRecovery

}

Additional context

No response

clumnah commented 7 months ago

This is not something we can fix as logical names of a database cannot be changed during a recovery operation. You are able to change the path and physical name though.

nthoman commented 7 months ago

Thanks… we will look into changing how we organize our DBs then.

Nick Thoman Senior Systems Engineer | Information Services Brethren Mutual Insurance Company w: 240-469-2202 m: 301-512-4554 e: @.**@.> For support requests please email: @.**@.>

On Jan 29, 2024, at 1:47 PM, Chris Lumnah @.***> wrote:

 This is not something we can fix as logical names of a database cannot be changed during a recovery operation. You are able to change the path and physical name though. — Reply to this email directly, view it on GitHub, or unsubscribe. You

This is not something we can fix as logical names of a database cannot be changed during a recovery operation. You are able to change the path and physical name though.

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/847*issuecomment-1915351331__;Iw!!E3q_Ug!2LyZbKFdFT_RZe7e5KdDfzVa2pgBhy5axTDN8CUyenVSLSACSdUZJ6oiMuPnq0k6LF4V3y_M19lPAR-CvB3D0A$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ALQNAZ3DWSUCVEBDQWT6FV3YQ7VETAVCNFSM6AAAAABCHFEPHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJVGM2TCMZTGE__;!!E3q_Ug!2LyZbKFdFT_RZe7e5KdDfzVa2pgBhy5axTDN8CUyenVSLSACSdUZJ6oiMuPnq0k6LF4V3y_M19lPAR8hNuMCDw$. You are receiving this because you authored the thread.Message ID: @.***>

mwpreston commented 2 months ago

Thanks @clumnah - closing at it appears there is nothing we can do here...