OLE DB error 0x80004005 using Copy Database Wizard
Community wiki answer:

Use backup and restore instead.

You can write dynamic SQL to do what you said, or just use Copy-DbaDatabase in the PowerShell dbatools to fully automate the task.