For My issue with Copy Database Wizard: Error: Value cannot be null. Parameter name: database StackTrace: at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.CheckLocalandDestinationStatus
I had tried everything in trying to get my Copy Database wizard to work through a schedule from SQL 2012 to SQL2017
1. I had set the SQL Agent account to an administrator, even though I had already set up a proxy that was a sysadmin
2. I had gone into data tools, and tried to change the max errors to more than one.
The final steps I took that worked were as follows:
A. I installed data tools on the 2017 server (just in case I needed them)
B. I added a dummy database on the 2017 server just so I could get to Copy Database wizard from inside SSMS.
C. I started the opy database wizard from my NEWER system from the dummy database, but changed my source to the source server(instead of the default of the local SQL instance), and respectively changed my target to my local machine SQL instance.
D. I went through the wizard for each item (for my case, it was a copy and replace option, using SSMS (not detach and re-attach as I couldn't bring down the source on production), and I clicked REFRESH on each database copy wizard screen AFTER changing the destination directory.
(ONE CAVIAT IF MIGRATING DATABASES ON SSMS 2017 for SQL 2017. Make sure you have the latest cumulative update for the SQL version: https://support.microsoft.com/en-us/help/4342123 vs. select @@version in a query
Also make sure youre SQL agent and SQL server accounts have permission to the target directory)
Following that, my script finally worked running from the SQL2017 server, having been added to SQL Agent Jobs