7.3. Updating the Database Using Save and Restore


VoltDB Home » Documentation » Using VoltDB

7.3. Updating the Database Using Save and Restore

If you need to make changes that are not supported by the voltadmin update command, it is still possible to modify the database schema using save and restore. You can modify the schema, including adding new constraints or modifying views, using the following steps:

  1. Save the current data, using voltadmin save.

  2. Shut down the database, using voltadmin shutdown.

  3. Replace the application catalog.

  4. Restart the database with the new catalog, using voltdb create.

  5. Reload the data saved in Step #1 using voltadmin restore.

Using these steps, you can add or remove tables, columns and indexes. You can also change the datatype of existing columns, as long as you make sure the new type is compatible with the previous type (such as exchanging integer types or string types) and the new datatype has sufficient capacity for any values that currently exist within the database.

However, you cannot change the name of a column, add constraints to a column or change to a smaller datatype (such as changing from INTEGER to TINYINT) without the danger of losing data. To make these changes safely, it is better to add a new column with the desired settings and write a client application to move data from the original column to the new column, making sure to account for exceptions in data size or constraints.

See Section 9.1.3, “Changing the Database Schema or Cluster Configuration Using Save and Restore” for complete instructions for using save and restore to modify the database schema.