Articles in this section

Is it possible to change the set when restoring an Aerospike backup?

Detail

In some instances it may be desirable to change the set a backup is restored into from the original set to a new set. The set name is stored in plain text in the backup file, is it therefore possible to change this and restore from that backup changing the set?

Answer

It is not possible to change the name of the set to restore into using only asbackup 5 and asrestore 1 tools. Although it is present in plain text in the backup file, the set name is contained in the record digest which is a one way hash. To re-compute the digest, the primary key must be stored, and this is not done by default. Thus, replacing the setname in a backup file in order to restore to a different set would require a complex workaround.

Notes

The digest is calculated by taking a set name and the key together. Therefore, unless the primary key was also saved into the database, changing/adding a set name will not be possible as it will cause unintended consequences (set name being computed in the digest not matching the set name saved with the record).

The best way to store the key as well as the digest is by setting a SendKey policy on the client: https://www.aerospike.com/apidocs/java/com/aerospike/client/policy/Policy.html#sendKey

Such workaround would require,  the primary_key to be present in the backup file (and therefore, to have been stored, per a non default client policy) and would then recompute the records digests using the new set name.

It is generally discouraged to change set names on existing data sets with this method, due to high probability of error. 


Applies To Earliest Version

Pre 4.9

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful