Skip to content

Commit ce04708

Browse files
Copy-DbaDatabase - Pass IgnoreFileChecks to Backup-DbaDatabase for UNC paths (#10360)
1 parent d9efe17 commit ce04708

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/reposize.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
state: all
1616

17-
- name: Repository size should be less than 90MB
17+
- name: Repository size should be less than 105000 KiB
1818
env:
1919
PR: ${{ steps.findpr.outputs.pr }}
2020
shell: pwsh
@@ -26,9 +26,9 @@ jobs:
2626
gh pr checkout $env:PR
2727
$objects = git count-objects -v
2828
$sizepack = $objects -split '`n' | Where-Object { $PSItem -match "size-pack" }
29-
$size = $sizepack -split " " | Select-Object -Last 1
29+
$size = [int]($sizepack -split " " | Select-Object -Last 1)
3030
Write-Output "Repo size is $size"
31-
# old size = 110299 or 250000+
32-
if ($size -gt 95000) { # Size is 89836, so 95000 should last a while
33-
throw "This clone is outdated. Please reclone your repo and resubmit with the slimmed down repo. See https://github.com/dataplat/dbatools/pull/8637 for more information."
34-
}
31+
# old size = 110299 or 250000+
32+
if ($size -gt 105000) { # Size is 96250, so 105000 keeps headroom while catching old clones
33+
throw "This clone is outdated. Please reclone your repo and resubmit with the slimmed down repo. See https://github.com/dataplat/dbatools/pull/8637 for more information."
34+
}

public/Copy-DbaDatabase.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,10 +1239,18 @@ function Copy-DbaDatabase {
12391239
}
12401240

12411241
} else {
1242+
$splatBackup = @{
1243+
SqlInstance = $sourceServer
1244+
Database = $dbName
1245+
BackupDirectory = $SharedPath
1246+
FileCount = $numberfiles
1247+
CopyOnly = $CopyOnly
1248+
IgnoreFileChecks = $true
1249+
}
12421250
if ($AdvancedBackupParams) {
1243-
$backupTmpResult = Backup-DbaDatabase -SqlInstance $sourceServer -Database $dbName -BackupDirectory $SharedPath -FileCount $numberfiles -CopyOnly:$CopyOnly @AdvancedBackupParams
1251+
$backupTmpResult = Backup-DbaDatabase @splatBackup @AdvancedBackupParams
12441252
} else {
1245-
$backupTmpResult = Backup-DbaDatabase -SqlInstance $sourceServer -Database $dbName -BackupDirectory $SharedPath -FileCount $numberfiles -CopyOnly:$CopyOnly
1253+
$backupTmpResult = Backup-DbaDatabase @splatBackup
12461254
}
12471255
}
12481256

0 commit comments

Comments
 (0)