If you have an existing system but you are installing OpenVPMS on a new machine, you essentially go through the steps for a new install, but instead of creating a new openpms database, you restore your existing one, and then migrate that to the new release.
The steps are as follows:
If the existing database is from OpenVPMS 2.2 or higher, the openvpms.properties file needs to be copied from the existing installation to the new installation.
This is located in <OPENVPMS_HOME>/conf.
If the existing database is from an earlier release, openvpms.properties needs to be configured. See Run 'toolbox configure'.
To create an OpenVPMS database, run the following in a shell prompt:
> cd <OPENVPMS_HOME>/bin > toolbox database --create --empty -u <admin-user> -p <admin-password> Created openvpms
Replace <admin-user> with a user that has administrator privileges in MySQL and <admin-password> with their password.
This:
The user only has privileges to connect from localhost. If the MySQL database is a different host to that running Tomcat, use the --host argument to specify the Tomcat host:
> toolbox database --create -u <admin-user> -p <admin-password> --host <tomcat-host>
Once the database is created, the mysql utility can be used to restore the backup onto the new machine. This is done using the command:
> mysql -u <admin-user> -p openvpms < openvpms.sql
where:
If the database to restore a backup to already exists, it should be dropped first.
> mysql -u <admin-user> -p > drop schema openvpms; Query OK, 46 rows affected (1.04 sec) > quit