Home > PKI, Security > Migrating an EJBCA database from H2 to mysql

Migrating an EJBCA database from H2 to mysql

As part of a job I had to migrate an EJBCA database from H2 to mysql. Some coworkers who tried migrating the database could not complete the job because most tools they used couldn’t open the H2 database or had problems with binary blobs. Googling ‘ejbca migrate h2 to mysql’ yielded the following result: https://sourceforge.net/p/ejbca/discussion/123123/thread/c9fb72aa/. According to Tomas Gustavsson, author of EJBCA, this is not trivial and “PrimeKey has developed a standalone database dump/restore tool that can be used to dump from one database and import into anohter. This is only available with a commercial support subscription though.” As far as I know, commercial support costs 9k per year. So, I decided to write my own migration tool. After less than 80 lines of java code everything was complete, and I migrated my database without any problems. You can download the tool here. There are no warranties that it will work correctly, but in my case it worked just fine. You can run it using the following command:

It may also work using other databases, you just have to use the correct connector and URL for the connection. If you try it with another database, such as postgresql, please leave a comment.

Categories: PKI, Security Tags:
  1. No comments yet.
  1. No trackbacks yet.

This site is using OpenAvatar based on


SEO Powered by Platinum SEO from Techblissonline
%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.