K2 Five (5.1) includes PowerShell commands that allow you decrypt and encrypt database data with your own password. This lets you move data from the K2 database to another SQL instance and use your own encryption password.
On-premises SQL servers use SCSSO key encryption, in which SQL creates a certificate and a master key for that certificate, and then uses it to encrypt the data in the SQL server. SQL Azure does not support this method so you can only use the PowerShell commands in this article with on-premises SQL servers.
Use the following PowerShell command to import the module and make the commands available. Run Windows PowerShell as the Administrator and enter this command in the folder where you extracted the K2 installation package (for example C:\Users\Administrator\Desktop\K2 (5.1004.0000.0)\Installation):
In this scenario, you change the default K2 encryption password to something you choose. Then you export and restore the database to another SQL instance and remove the old encryption. Lastly, you add the new encryption with your new password. Enter the following command in Windows PowerShell:
This test scenario shows you how to confirm that you can retrieve data before and after exporting it to a new SQL instance. The first section tests data before a database export and the second section tests data after export and restoration in another SQL instance.
Use the following steps to restore the database to another SQL instance, recreate the keys, and confirm the values decrypt correctly by using the following steps.