bchorangehrm

Upgrade OrangeHRM

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

It is strongly recommended to create a backup before starting the update process. If you have important data, create and try to restore a backup to ensure that everything works properly.

You can upgrade the application only without modifying any other stack components. Follow these steps:

  • Back up your current OrangeHRM database.

      $ cd /opt/bitnami/mysql
      $ bin/mysql -u root -p
    
  • Create a new database and assign permissions to the user of the orangehrm database.

      mysql> CREATE DATABASE bitnami_orangehrm_backup;
      mysql> GRANT ALL PRIVILEGES ON bitnami_orangehrm_backup.* TO 'bn_orangehrm'@'localhost' IDENTIFIED BY 'PASSWORD';
      mysql> exit;
    
  • Create OrangeHRM tables in the new database:

      $ bin/mysqldump -u root -p bitnami_orangehrm > /home/bitnami/ohrm_backup.sql
      $ bin/mysql -u root -p -o bitnami_orangehrm_backup < /home/bitnami/ohrm_backup.sql
    

The next steps will depend on your installation type.

Approach A: Bitnami installations using system packages

  • Remove the actual content of the /opt/bitnami/orangehrm directory and uncompress the new version of OrangeHRM to the same location.

      $ cd /opt/bitnami
      $ sudo rm -rf orangehrm/
      $ sudo unzip orangehrm-version.zip
      $ mv orangehrm-version/ orangehrm/
    
  • Change the ownership of the files and their permissions:

      $ chown -R bitnami:daemon /opt/bitnami/orangehrm/
      $ chmod -R 775 upgrader/ lib/ symfony/
    

Approach B: Self-contained Bitnami installations

  • Remove the actual content of the /opt/bitnami/apps/orangehrm/htdocs directory and uncompress the new version of OrangeHRM to the same location.

      $ cd /opt/bitnami/apps/orangehrm
      $ sudo rm -rf htdocs/
      $ sudo unzip orangehrm-version.zip
      $ mv orangehrm-version/ htdocs/
    
  • Change the ownership of the files and their permissions:

      $ chown -R bitnami:daemon /opt/bitnami/apps/orangehrm/htdocs/
      $ chmod -R 775 upgrader/ lib/ symfony/
    
  • Launch the upgrade wizard. Access it in the web browser by navigating to http://SERVER-IP/upgrader/web/index.php:

    OrangeHRM upgrade

  • Complete the fields as is shown in the image. The password is the same that you put in the “GRANT ALL PRIVILEGES” command. Follow the remaining instructions.

  • Clean up and remove the old database and the backup file:

      $ /opt/bitnami/mysql/bin/mysql -u root -p
      mysql> DROP DATABASE bitnami_orangehrm_backup;
      mysql> exit;
      $ rm /home/bitnami/ohrm_backup.sql
    
Last modification January 19, 2021