15 Performing your first advanced SQL Server instance migration, part 1

 

Within the SQL Server community, simplified migrations sparked wide adoption of not just dbatools but PowerShell as well. The videos showing instance-to-instance migrations, such as sqlps.io/instmigration, resonated with DBAs. This video revolved around our flagship command, Start-DbaMigration, which migrates one entire SQL Server instance to another and can be as straightforward as the code seen in the next listing.

Listing 15.1 Using Start-DbaMigration to migrate one instance to another
PS> Start-DbaMigration -Source sql01 -Destination sql02 -BackupRestore
 -SharedPath \\nas\sql\migration

This command wraps a bunch of other Copy-Dba* commands and simplifies a complex process that copies logins with all their properties and passwords; linked servers; and credentials with their passwords, Agent jobs, schedule, operators, and more. But we know that SQL Server migrations are often not as simple or as quick as the video shows.

Migrating large databases using the backup and restore method, or even detach and attach, can require long downtimes for the systems that rely on those databases, while all of the data is moved. SQL Server instances that have existed for a long time may have a large number of SQL Agent jobs, logins, linked servers, or other objects that are no longer in use, and migrating those is unnecessary.

15.1 Databases

15.1.1 Backup and restore

15.1.2 Detach and attach

15.1.3 Staging large databases for migration

15.1.4 Other database migration options

15.2 Hands-on lab