Upgrade code with two different datatypes

Hi All,

We are writing upgrade code for a field, which was xs:string in version 2 and tailf:des3-cbc-encrypted-string in version 3. I want to move the value to another place. By reading the value from cdb, how to I know whether it is plain-text (xs:string) or encrypted(des3-cbc-encrypted-string)?

Thanks in advance, Prasanth

Leaf values defined as des3-cbc-encrypted-string will have the “$3$” prefix when read from CDB. You can find out more details about this data type in the confd_types section of Volume 3 of the ConfD man-pages.

Thanks. I will use that trick but there is a catch. What if a user set a string starting with “$3$”. We will not be able to differentiate it.

Back to your original posting. During the upgrade process from v2 to v3, you will know that whatever values you read from CDB at the time of the upgrade are the plain text ones. There really shouldn’t be a need for you to use this logic at all.

I think I didn’t explain it well earlier. From V1 to V5 it is string. From V5 to V10 the type is changed to encrypted.
On V11, the field value is move to another place (still encrypted). Now the upgrade can come from any of the previous versions and I am not keeping track of the versions which has plain text/encrypted. I want my upgrade code to move the data from old to new location.

So in this case is there any way to identify, if the value coming from cdb is encrypted or not?

Thanks, Prasanth