Upgrade the Vault Schema
This section describes how to upgrade an existing SFNT_KEY_TABLE and token vault. The installation program enables you to upgrade token vaults created in previous versions, such as 5.3, 5.5, 5.5.1, 6.2.x, or 6.6.x. The upgrade program alters the sfnt_key_table for your database and then offers you the option of converting your token vaults. This section also explains how the sfnt_key_table and token vaults are changed during the upgrade and provides an example of the upgrade portion of the installation script.
This section covers the following topics:
Note
Your permission is required for all table structure changes. The installation program prompts before updating sfnt_key_table and you must trigger the upgrade for each token vault.
Upgrading the SFNT_KEY_TABLE
There is one sfnt_key_table per database/schema, so this upgrade occurs only once per database/schema. Before the upgrade, a sfnt_key_table created in version 5.5.1 has the following structure:
ENCKEY | HMACKEY | TABLENAME |
---|---|---|
encKey1 | macKey1 | TOKEN_VAULT_1 |
encKey2 | macKey2 | TOKEN_VAULT_2 |
encKey3 | macKey3 | TOKEN_VAULT_3 |
The sfnt_key_table adds the TOKENVAULTNAME and KEYROTATIONDATE columns. An upgraded version of the table shown above would look like this:
ENCKEY | HMACKEY | TABLENAME | TOKENVAULTNAME | KEYROTATIONDATE |
---|---|---|---|---|
encKey1 | macKey1 | TOKEN_VAULT_1 | TV$TOKEN_VAULT_1 | |
encKey2 | macKey2 | TOKEN_VAULT_2 | TV$TOKEN_VAULT_2 | |
encKey3 | macKey3 | TOKEN_VAULT_3 | TV$TOKEN_VAULT_3 |
Notice that the values in the TOKENVAULTNAME column append TV$ to the TABLENAME values. The TV$ is removed when the token vault itself is upgraded.
The KEYROTATIONDATE column enables the CT-V to track when key rotations occur, and to continue rotations if they are interrupted. For more information on key rotations, see Rotating and Re-Keying the Token Vault.
Upgrading a Token Vault
You must upgrade each token vault individually. Before upgrading, ensure to take the old version of CT-V instance offline and all access to the token vault must be stopped; otherwise, the incoming data will be lost. After upgrade, you can resume the CT-V operations.
Note
It is recommended to upgrade the Token Vault schema before using the Tokenization APIs.
Before the upgrade, a token vault created in lower version, for example, 8.4.0 has the following structure. (A few columns have been abridged to make the text readable.)
After upgrading, the table shown above would look like this:
Note
When upgrading CT-V to the latest version, ensure to use the latest version of jars provided in the /SafeNetTokenization/Tokenization/lib/ext directory.
Sample Upgrade Script
The following sample is an excerpt of upgrade for SQL Server.
The following sample is an excerpt of upgrade for MySQL.
Note
For MySQL, if the token vault contains duplicate macvalues then the upgrade will be terminated with the following message:
Vault Schema upgrade is not successful: Cannot upgrade the schema as same plaintext with different custom data is not supported. Please restore the old version libraries from the backup and remove the new version libraries from the CT-V installed directory manually !!!