[X ] Verified errors are not related to permissions
[ ] Is this bug with Copy-DbaDatabase? You can replicate it using Backup-DbaDatabase ... | Restore-DbaDatabase ...
NOTE: Copy-DbaDatabase will not work in every environment and every situation. Instead, we try to ensure Backup & Restore work in your environment.
Environmental data
<#
Name Value
---- -----
PSVersion 5.1.14393.2608
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.2608
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
### dbatools Module version:
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.803\dbatools.psd1
Version : 0.9.803
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.800\dbatools.psd1
Version : 0.9.800
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.797\dbatools.psd1
Version : 0.9.797
#>
SQL Server:
/* Microsoft SQL Server 2016 (SP2-CU2) (KB4340355) - 13.0.5153.0 (X64) Jun 28 2018 17:24:28 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Standard 10.0 <X64> (Build 14393: ) (Hypervisor) */
once the restore is done the database should be set to READ_WRITE and then the ownership should be updated
Actual Behavior
VERBOSE: [04:20:44][Set-DbaDbOwner] Setting database owner for MyDB to OwnerName on DestHost\DestInstance.
WARNING: [04:20:44][Set-DbaDbOwner] MyDB on DestHost\DestInstance is not in an updateable state and can not be altered. It will be skipped.
VERBOSE: [04:20:44][Copy-DbaDatabase] Failed to update database owner.
VERBOSE: [04:20:44][Set-DbaDbState] Setting database [MyDB ] to READ_WRITE
Copy-DbaDatabase
? You can replicate it usingBackup-DbaDatabase ... | Restore-DbaDatabase ...
Environmental data
SQL Server:
Steps to Reproduce
Expected Behavior
once the restore is done the database should be set to READ_WRITE and then the ownership should be updated
Actual Behavior
VERBOSE: [04:20:44][Set-DbaDbOwner] Setting database owner for MyDB to OwnerName on DestHost\DestInstance. WARNING: [04:20:44][Set-DbaDbOwner] MyDB on DestHost\DestInstance is not in an updateable state and can not be altered. It will be skipped. VERBOSE: [04:20:44][Copy-DbaDatabase] Failed to update database owner. VERBOSE: [04:20:44][Set-DbaDbState] Setting database [MyDB ] to READ_WRITE