Migration Steps
Let’s assume your current database is calledlegacyDB, and it’s encrypted with a DEK protected by a software certificate (which is SQL Server’s default when TDE is initially enabled). Our goal: rewrap that DEK under EkmAsym without re-encrypting the data.
Here’s the migration procedure:
Verify Current Encryption StateLook for:
Sql
encryption_state = 3→ means “encrypted”encryptor_type = CERTIFICATE→ this confirms it’s using the software certificate
Back Up the Current CertificateIt is highly recommended to backup the current certificate in case you need to decrypt older backups:Replace
Sql
YourCurrentTDECert with the actual certificate name from:Sql
Rewrap the DEK with the This rewraps the existing DEK under Expected result:
EkmAsym key created on the KMES through EKM in the Enable TDE in Microsoft SQL Server by using EKM section.Sql
EkmAsym. SQL Server does not generate a new DEK - it just updates the protector.You can verify the switch by running this command again:Sql
encryption_state = 3→ means “encrypted”encryptor_type = ASYMMETRIC KEY→ this confirms it’s using the EKM-stored key

