OpenRIMS-RPM - Upgrade Part 1: Difference between revisions

From OpenRIMS Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= Objective =
=== '''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.
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.


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


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


= Tool =
=== '''Tool''' ===
               The tool is the latest version of MySQL Workbench.
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” (<nowiki>https://dev.mysql.com/doc/workbench/en/wb-database-synchronization.html</nowiki>) provided by the 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” (<nowiki>https://dev.mysql.com/doc/workbench/en/wb-database-synchronization.html</nowiki>) provided by the MySQL Workbench.


               This feature:
This feature:


1.      reads the latest and the current database structures,
# reads the latest and the current database structures,
# compares them
# creates a script to upgrade the current database to the latest database structure
# executes this script


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


3.      creates a script to upgrade the current database to the latest database structure
=== '''Pre-requisites''' ===
 
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.
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
Figure 1. The connection to the latest database


= The sequence of steps =
=== '''Process steps''' ===
               Suppose you need to update the database structure of a database on the localhost.
Suppose you need to update the database structure of a database on the localhost.


Figure 2. Create a '''new''' model
Figure 2. Create a '''new''' model


Figure 3. Run the feature
Figure 3. Run the feature


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


Figure 5. Tap the radio buttons
Figure 5. Tap the radio buttons


Figure 6. The latest database is on pdx2demo.ddanet.org. It is the source of the changes
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 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 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 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 10. Compare the source and the target


Figure 11. Revise the changes.
Figure 11. Revise the changes.
Line 83: Line 62:
Figure 12. The result DDA SQL script. There are no changes
Figure 12. The result DDA SQL script. There are no changes


= Linux particularities =
=== '''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.
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.

Latest revision as of 16:53, 28 June 2024

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-requisites

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

Process 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.