-
-
Notifications
You must be signed in to change notification settings - Fork 852
Description
Verified issue does not already exist?
I have searched and found no existing issue
What error did you receive?
Using Cop-DBaDatabase to Move a database to another server using the "-SetSourceOffline" option, it will still set the source offline even if the copy DIDN'T Go through. You can see it even tries to continue the process in the script without noticing the database isn't there.
Also I think this should throw an error instead of a warning so it can be picked up by a try/catch.
WARNING: [08:33:17][Copy-DbaDatabase] Failure attempting to restore to | Microsoft.Data.SqlClient.SqlError: There is
insufficient free space on disk volume 'E:' to create the database. The database requires 677288869888 additional free bytes, while only 515491758080 bytes are
available.
WARNING: [08:33:19][Copy-DbaDatabase] Failure setting to read-write on destination server | An exception occurred while executing
a Transact-SQL statement or batch.User does not have permission to alter database , the database does not exist, or the
database is not in a state that allows access checks.
ALTER DATABASE statement failed.
WARNING: [08:33:19][Copy-DbaDatabase] Failed to update DatabaseOwnershipChaining for False on on .
WARNING: [08:33:19][Copy-DbaDatabase] Failed to update Trustworthy to False for on .
WARNING: [08:33:19][Copy-DbaDatabase] Failed to update BrokerEnabled to False for on .
Steps to Reproduce
PrePReq: Target server must have lack of diskspace to contain the whole database.
Copy-DbaDatabase -Source -Destination -BackupRestore -SharedPath \\ -SetSourceOffline -Database
Please confirm that you are running the most recent version of dbatools
2.1.26
Other details or mentions
No response
What PowerShell host was used when producing this error
Windows PowerShell (powershell.exe)
PowerShell Host Version
Name Value
PSVersion 5.1.19041.5007
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.5007
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
SQL Server Edition and Build number
SQL2022
.NET Framework Version
PSChildName Version
Client 4.8.09037
Full 4.8.09037
Client 4.0.0.0