Jordan Boich performs a migration:
I’ve been automating a lot of the tedious and routine migration tasks for our team for the past few months. Leveraging tools like PowerShell and Azure DevOps Pipelines to consistently deliver results and accomplish the majority of the heavy lifting relating to DBA toil allows us to focus on other tasks and initiatives. While improving my pipeline process, I noticed that the TDE cert migration portion was unreliable and failing often. The specific step backed up the .cer and .pvk file to a network share and attempted to assign file share permissions, and restore the cert with its pvk to the destination server. Connectivity to the share was unreliable, and trying to play permission assignments to a share in flight proved to be more challenging than I was hoping. With that, I sought out a new way to skin the cat. Turns out, you can leverage the certificate’s binary metadata to migrate the TDE cert to another server without having to worry about physical .cer and .pvk files to make that possible. You don’t need a pipeline for this to be useful. Here’s what it looks like by hand.
Click through for the process.