Sql-server – Recover all databases to a new server

restoresql server

I need to copy an entire SQL Server instance, with all databases from one server to another server in my test lab.

I am aware that this can be done the "cold way", by stopping/pausing the databases and copying the database files to new location and attaching them.

Is it however possible to do it the "hot way," using the full and diff backup files?

Best Answer

You can just use dbatools --> Start-DbaMigration to do the entire server migration/copy - (choose backup/restore method) including jobs, logins, user objects created in system dbs, etc

Start-DbaMigration
    [[-Source] <DbaInstanceParameter>] [[-Destination] <DbaInstanceParameter[]>]
    [-DetachAttach] [-Reattach] [-BackupRestore] [[-SharedPath] <String>]
    [-WithReplace] [-NoRecovery] [-SetSourceReadOnly] [-ReuseSourceFolderStructure]
    [-IncludeSupportDbs]
    [[-SourceSqlCredential] <PSCredential>]
    [[-DestinationSqlCredential] <PSCredential>]
    [[-Exclude] <String[]>] [-DisableJobsOnDestination] [-DisableJobsOnSource]
    [-ExcludeSaRename] [-UseLastBackup] [-Continue] [-Force] [-EnableException]
    [-WhatIf] [-Confirm] [<CommonParameters>]