Notary database migration

With the MySQL notary being deprecated, Corda Enterprise notary operators should consider moving to a database supported by the JPA notary instead.

Migrating from one notary implementation to another is a complex procedure and should not be attempted unless there is significant benefit from the migration. Possible reasons for migration include:

  • Higher performance is required than a simple notary solution, but the user wishes to use their existing database.
  • A highly available solution is required and the current database is not highly available.
  • Greater scalability or performance is required than a highly available MySQL notary installation.

The recommended migration path would be to migrate the data stored in the source database to the target database. The data would then be restored to a new database and the notary’s configuration changed to reflect the new database. Thus, the identity of the notary would not change and transactions would still target it. However, the notary will have to be shutdown for a short period of time during the migration.

  • The JPA notary uses a different database schema to the Simple or MySQL notaries, and thus a transformation must be applied.
  • The notary must be shut down during the final phase of migration.
  • Depending on the number of states notarized by the notary, the amount of time taken to transfer the data could be significant.
TableSource Column(s)Target Column(s)Expression
notary_committed_statestransaction_id
output_indexstate_refstate_ref = transaction_id + ‘:’ +
output_index
TableSource Column(s)Target Column(s)Expression
notary_committed_statesissue_transaction_id
issue_transaction_output_idstate_refstate_ref = issue_transaction_id + ‘:’ +
issue_transaction_output_id
notary_request_logrequest_daterequest_timestamprequest_timestamp = request_date
  • Use the Corda Database Management Tool to prepare the schema in the target database.

  • Obtain the latest backup of the source database.

  • Extract the data from the source database, transform it and load the data into the target database.

  • Loading this older copy of the data from the source database into the target database reduces the time taken for the final step.

  • Shutdown the notary, and when the notarisation request queue is drained, disconnect the source database to prevent any new data being written to it.

  • Perform a diff backup in order to retrieve the data that has been written to the database since the backup restored in Step 3.

  • Use the same transformation in order to load the diff backup into the target database.

  • Verify that the target database contains all of the data present in the source database.

  • Reconfigure the notary to use the JPA notary connected to the target database.

  • Restart the notary.

  • Verify that the notary operates normally.

Was this page helpful?

Thanks for your feedback!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.

We're sorry this page wasn't helpful. Let us know how we can make it better!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Create an issue

Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.