1. Create a directory for the environment, e.g. : /usr/local/env/demo
2. Unzip OpenIDM:
Open up openidm/conf/repo.orientdb.json and take a quick look.
What we have here is a set of queries for the OOTB embedded OrientDB. We are going to replace this with a compatible SQL based version.
3. Run the following script to configure the OpenIDM schema:
mysql -u root -p < /usr/local/env/demo/openidm/db/mysql/scripts/openidm.sql
Here I run it for mysql against the root user. You will be asked for a password, please enter it. This script will create an openidm schema.
4. Next we need to run some additional scripts.
mysql -D openidm -u root -p < /opt/forgerock/openidm/db/mysql/scripts/activiti.mysql55.create.engine.sql
mysql -D openidm -u root -p < /opt/forgerock/openidm/db/mysql/scripts/activiti.mysql55.create.history.sql
mysql -D openidm -u root -p < /opt/forgerock/openidm/db/mysql/scripts/activiti.mysql.create.identity.sql
These scripts set up the Activiti BPMN workflow engine in the openidm database instance we just created.
5. Now lets remove the original repo.orientdb.json file. Don’t forget to do this step! I’d also suggest making a backup:
mv repo.orientdb.json backup
6. Next we need to copy over the database specific configuration files:
cp db/mysql/conf/repo.jdbc.json conf
cp db/mysql/conf/datasource.jdbc-default.json conf
Again, let’s take a quick look at these files , repo.jdbc.json:
You’ll notice that what we have is an SQL version of the repo file we looked at earlier, ready to execute queries against a MySQL like database. There is also one other notable difference:
The original repo did not have this line. Well, this line is used to specify the datasource to be used i.e. our MySQL database, and it refers to the second file we copied over datasource.jdbc-default.json:
8. Ensure that the useDataSource (default) value matches the datasource specification datasource.jdbc-default.json
9. Configure the datasource.jdbc-default.json file for your MySQL database. Specifically the jdbcUrl, databaseName, username and password.
10. Update workflow.json to use the same datasource i.e. default.
To be very clear, if you named your datasource specification datasource.jdbc-example.json then your useDataSource value should be example in the files above.
11. That’s it. You should be able to start openidm up normally: