We migrated our databases to a new server (both are Win 2008 R2). I backup previous databases, restore on the new server with full recovery mode. While clients' emails and password are failed to decrypt, they got error message as follows.
Microsoft OLE DB Provider for SQL Server error '80040e14' Cannot find the symmetric key 'Generickey', because it does not exist or you do not have permission.
I check databases in the new machine and database master key, certificate as well as symmetric keys are there . Do I need drop those in the new server, backup and restore those them? Or I need recreate them? or I need backup, restore the service master key.
In OLD database, I created those as follows.
Use dbname
GO
GO
CREATE MASTER KEY ENCRYPTION
BY PASSWORD = 'HRpassword'
GO
CREATE CERTIFICATE EncryptCert
WITH SUBJECT = 'General certificate', EXPIRY_DATE = '12/11/2020'
Go
CREATE SYMMETRIC KEY Generickey
WITH ALGORITHM = TRIPLE_DES ENCRYPTION
BY CERTIFICATE EncryptCert
GO
In NEW database, I tried
OPEN MASTER KEY DECRYPTION
BY PASSWORD = 'HRpassword'
It is executed successfully.