You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backup-DbaDatabase : add a switch that will prevent to always append dbname in the directory backup path and strictly respect the given path variable.
#9346
Open
rferraton opened this issue
May 13, 2024
· 0 comments
For the command Backup-DbaDatabase, add a switch that will prevent to always append dbname in the directory backup path and strictly respect the given path variable.
Cause : Currently, Backup-DbaDatabase always appended the DbName in the backup path. This can be problematic in some cases where the backup path try to respect Ola Hallengren default path model and when the database name is long. In this case the current dbname appending lead to repeat the dbname twice in the backup path and can cause a "backup path too long" error.
Suggested switch name -NoAppendDbNameInPath
Default value would remain false to avoid impact on the existing backups scripts
Is there a command that is similiar or close to what you are looking for?
Yes
Technical Details
line 664 in Backup-DbaDatabase.ps1 :
if ($CreateFolder-and$FinalBackupPath[0] -ne'NUL:') {
for ($i=0; $i-lt$FinalBackupPath.Count; $i++) {
$parent= [IO.Path]::GetDirectoryName($FinalBackupPath[$i])
$leaf= [IO.Path]::GetFileName($FinalBackupPath[$i])
if ($NoAppendDbNameInPath) {
$FinalBackupPath[$i] = [IO.Path]::Combine($parent,$leaf)
} else {
$FinalBackupPath[$i] = [IO.Path]::Combine($parent,$dbName,$leaf)
}
}
}
The text was updated successfully, but these errors were encountered:
Summarize Functionality
For the command Backup-DbaDatabase, add a switch that will prevent to always append dbname in the directory backup path and strictly respect the given path variable.
Cause : Currently, Backup-DbaDatabase always appended the DbName in the backup path. This can be problematic in some cases where the backup path try to respect Ola Hallengren default path model and when the database name is long. In this case the current dbname appending lead to repeat the dbname twice in the backup path and can cause a "backup path too long" error.
Suggested switch name -NoAppendDbNameInPath
Default value would remain false to avoid impact on the existing backups scripts
Is there a command that is similiar or close to what you are looking for?
Yes
Technical Details
line 664 in Backup-DbaDatabase.ps1 :
The text was updated successfully, but these errors were encountered: