Press "Enter" to skip to content

Performing A Database Migration With dbatools

Viorel Ciucu has a Powershell script using dbatools to configure a new SQL Server instance and migrate databases using TDE over to the new instance:

The second option (and the one we chose) was to leave the encryption enabled. In order to be able to attach the files, or to do restores from the backupsĀ you need to have the same certificate that was used for encryption. This certificate is protected by the master key.

To accomplish this:

  1. Make backups of the master key and the certificates

  2. Restore the key and certificates on the new principal and mirror pairs

Read on for the process.