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:
If the MySQL database is a different host to that running Tomcat, use the mysql utility to grant access using the command:
GRANT ALL PRIVILEGES ON <database-name>.* TO '<user-name>'@'%' IDENTIFIED BY '<user-password>' WITH GRANT OPTION;
Replace <database-name>, <user-name> and <user-password> with the corresponding values entered during toolbox configure.
To improve security, the '%' should be replaced with the host that Tomcat will connect from.
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