Now it’s time to take some backups. First, let’s back up the various keys and certificates:
123456789101112131415USE [master]GO--Back up the service master key--Note that the password here is the FILE password and not the KEY password!BACKUP SERVICE MASTERKEYTOFILE ='C:\Temp\ServiceMasterKey.key'ENCRYPTIONBYPASSWORD='Service Master Key Password';GO--Back up the database master key--Again, the password here is the FILE password and not the KEY password.BACKUP MASTERKEYTOFILE ='C:\Temp\DatabaseMasterKey.key'ENCRYPTIONBYPASSWORD='Database Master Key Password';GO--Back up the TDE certificate we created.--We could create a private key with password here as well.BACKUP CERTIFICATE [TDECertificate]TOFILE ='C:\Temp\TDECertificate.cert'WITHPRIVATEKEY(FILE ='C:\Temp\TDECertificatePrivateKey.key', ENCRYPTIONBYPASSWORD='Some Private Key Password');GO
Click through for the details.