Restoring the TDE Encrypted Database
On the same SQL Server VM, you can restore the backup using the following SQL statements:
Copy
USE [master]
RESTORE DATABASE testdb FROM DISK = N'D:\testdb.bak' WITH FILE = 1, NOUNLOAD, STATS = 5
To open old versions of the TDE key with its thumbprint, you will need to specify the key name starting with @ followed by the thumbprint of the key. For example:
Copy
USE master;
CREATE ASYMMETRIC KEY TDE_KEY_v1 -- Give the master key version a name in SQL Server
FROM PROVIDER EKM_Prov WITH
PROVIDER_KEY_NAME = '@E5196A7752214754934DF7BD479B6F7E', -- master key thumbprint
CREATION_DISPOSITION = OPEN_EXISTING;
GO