Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompressBackup option to Add-DbaAgDatabase #8120

Closed
cdbunch72 opened this issue Jan 26, 2022 · 3 comments · Fixed by #8135
Closed

CompressBackup option to Add-DbaAgDatabase #8120

cdbunch72 opened this issue Jan 26, 2022 · 3 comments · Fixed by #8135
Assignees
Labels
feature parameter Feature request that would need a new parameter for an existing command

Comments

@cdbunch72
Copy link

Summarize Functionality

When using the manual seeding mode with backup and restore it would be nice to have the option to compress the backup as the shared path may not be as large as the regular backup location.

Is there a command that is similiar or close to what you are looking for?

No

Technical Details

When calling Backup-DbaDatabase in the Add-DbaAgDatabase function it would be useful if you could specify -CompressBackup

@cdbunch72 cdbunch72 added feature triage required New issue that has not been reviewed by maintainers labels Jan 26, 2022
@wsmelton
Copy link
Member

wsmelton commented Feb 2, 2022

I would recommend this be added as an input object to pass advanced parameters to the Backup call. In place of us having to add all the possible parameters the command accepts to this AG command.

$addParams = @{
    SqlInstance = 'sql2017a'
    AvailabilityGroup = 'ag1'
    ....
    AdvancedBackupParams = @{
        CompressBackup = $true
        FileCount = 6
    }
}
Add-DbaAgDatabase @addParams

Each call to Backup-DbaDatabase would adding that splatted object: @AdvancedBackupParams

Write-Message -Level Verbose -Message "Taking full and log backup of database $($db.Name)."
$fullbackup = $db | Backup-DbaDatabase -BackupDirectory $SharedPath -Type Full -EnableException
$logbackup = $db | Backup-DbaDatabase -BackupDirectory $SharedPath -Type Log -EnableException
$backups = $fullbackup, $logbackup

One-off test shows it should work:

function t {param([psobject]$AdvancedInput) Get-Process @AdvancedInput}
t -AdvancedInput @{Name = 'pwsh'}

image

@andreasjordan
Copy link
Contributor

Good idea, will put that on my to do list...

@andreasjordan andreasjordan self-assigned this Feb 3, 2022
@andreasjordan andreasjordan added feature parameter Feature request that would need a new parameter for an existing command and removed triage required New issue that has not been reviewed by maintainers feature labels Feb 3, 2022
@andreasjordan
Copy link
Contributor

I had some spare minutes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature parameter Feature request that would need a new parameter for an existing command
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants