OpenRIMS-RPM - Upgrade Part 1

From OpenRIMS Wiki
Revision as of 18:44, 31 August 2023 by Khoppenworth (talk | contribs)
Jump to navigation Jump to search

Objective

A new release of OpenRIMS always contains changes in the software codes and, very often, in the database structure. To install a new release, it is necessary to replace the software codes and implement the database structure changes, if ones.

The implementation of the database structure changes will keep all data, however, will allow the use of the new release of the software.

Despite it being possible to use this feature for the production databases, it is recommended only for test and demo systems.

Here are the steps to perform an upgrade from any version of OpenRIMS to latest version.

  1. Connect to destination server UI or CLI
  2. Backup Database
  3. Download the new MySQL model file
  4. Stop the OpenRIMS service
  5. Rename old Application file
  6. Download the new Application file (https://github.com/MSH/OpenRIMS/raw/main/bin/pharmadex2-0.0.1.jar)
  7. Change Permissions on the .jar file to make it executable: sudo chmod -x pharmadex2-0.0.1.jar
  8. Use Workbench to upgrade db structure based on the model - see below
  9. Start the OpenRIMS service

Tool

               The tool is the latest version of MySQL Workbench.

               For current, the latest stable release of the database is in pdx2demo.ddanet.org. To upgrade the database in any other server, or, even, in the localhost it is possible to use the feature “Model – Synchronize with any source” (https://dev.mysql.com/doc/workbench/en/wb-database-synchronization.html) provided by the MySQL Workbench.

               This feature:

1.      reads the latest and the current database structures,

2.      compares them

3.      creates a script to upgrade the current database to the latest database structure

4.      executes this script

               The result is the equal data structures for the latest and the current database. The data is still the same as was before.

             

             

Pre-condition

               You should have full access rights to your database and add the connection to the latest database depicted below. Ask for a password by email to alex.kurasoff@gmail.com.

             

Figure 1. The connection to the latest database

The sequence of steps

               Suppose you need to update the database structure of a database on the localhost.

Figure 2. Create a new model


Figure 3. Run the feature

Figure 4. The representation of the feature is a "wizard"


Figure 5. Tap the radio buttons


Figure 6. The latest database is on pdx2demo.ddanet.org. It is the source of the changes

Figure 7. Suppose the database going to be updated is in the localhost. It is the target of the changes


Figure 8. Extract the list of all sources and all target databases.




Figure 9. Select the source database. The target database is at the bottom of the screen. By default, the names of the target and the source should be the same


Figure 10. Compare the source and the target


Figure 11. Revise the changes.

Figure 12. The result DDA SQL script. There are no changes

Linux particularities

               The MySQL database usage in Windows and Linux servers is slightly different. In the Linux server, the names of tables are cases sensitive, on Windows – no. There is any problem if the source server is under Linux, and the target server is under Windows. Otherwise, the tables SPRING_SESSION and SPRING_SESSION attributes should be ignored while synchronization. There are special tables that are in use by third-party software.