Earlier my code was having encryption methodology using 'attr_encrypted' but later I changed my mind to integrate vault for encryption/decryption. So I want to understand how can I migrate my old saved encrypted data to new one.
Migration from attr_encrypted to vault-rails gem
149 views Asked by Rahul Tibrewal At
1
Seems pretty straightforward. If you have, say, field
ssn
You can create a second field, now backed by vault
Then iterate your records and set
ssn2
value to that ofssn
. This should take care of data migration.After that is done, you might want to delete ssn's backing fields and rename ssn2's backing field(s), so that rest of your code continues to use name
ssn
.