dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Copy-DbaLogin hangs when database not present on destination server

Open TommyKF-DK opened this issue 3 years ago • 1 comments

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

Hello

I am migrating from a SQL server 2008 to a SQL server 2019 running on Windows Server 2019. I installed DBAtools version 1.1.125 on the 2019 server. When I run Copy-DbaLogin, it puts out warning and then hangs.

Warning message WARNING: [02:22:16][Copy-Login] Database MyDatabase does not exist on [DestinationSQL], switching DefaultDatabase to 'master' for fancyloginname

I tried to just leave it, but after 3 hours where no new logins were copied I stopped to process.

I copied all databases to destination server and then I was able to copy users without errors.

Steps to Reproduce

Copy-DbaLogin -Source SQL2008 -Destination SQL2019

Please confirm that you are running the most recent version of dbatools

PS C:\Users> Get-InstalledModule

Version Name Repository Description


1.1.125 dbatools PSGallery The community module that enable

Other details or mentions

No response

What PowerShell host was used when producing this error

Windows PowerShell ISE (powershell_ise.exe)

PowerShell Host Version

Name Value


PSVersion 5.1.17763.2931
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.2931
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

SQL Server Edition and Build number

Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor)

.NET Framework Version

.NET Framework 4.7.3946.0

TommyKF-DK avatar Aug 31 '22 12:08 TommyKF-DK

Can you reproduce the problem and run the command with -Verbose? Then we might see where it hangs.

andreasjordan avatar Sep 08 '22 07:09 andreasjordan

Will close this for now, but can reopen if needed.

andreasjordan avatar May 08 '23 14:05 andreasjordan