A similar question has been asked before, but I believe the circumstances are slightly different, and I'd also like to understand any alternative solutions. I'm at the stage of information overload right now :\
Certain columns on a database on SERVER A have been encrypted using this approach:
-- Key creation
USE [master];
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'ComplexPasswordHere';
CREATE CERTIFICATE MyDbCertificate01 WITH SUBJECT = 'MyDatabase Certificate 01';
CREATE SYMMETRIC KEY SSN_Key_01 WITH ALGORITHM = TRIPLE_DES ENCRYPTION BY CERTIFICATE MyDbCertificate01;
-- Decryption example
USE [MyDB];
GO
OPEN SYMMETRIC KEY SSN_Key_01 DECRYPTION BY CERTIFICATE MyDbCertificate01;
SELECT
CONVERT(nvarchar(50), DECRYPTBYKEY(PasswordEnc)) AS [Password]
FROM
[tbl_Users]
CLOSE SYMMETRIC KEY SSN_Key_01;
This database needs to be restored onto SERVER B, which already has a Service Master Key that governs encryption on other databases on that server.
From research, other authors state we can backup/restore the SMK using FORCE
, but I think that would obliterate existing encryption on the destination server:
And here lies the problem: The current machine DMK cannot be used on data encrypted with another SMK. It will fail to decrypt, because the SMK has changed. Source
Assuming the above is still accurate, can the database be backed up, along with perhaps the certificate, to enable the destination server to decrypt the data successfully?
Is there any other way to achieving this without damaging the destination server's existing data?