Upgrade OrangeHRM

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

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 "installdir/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 installdir/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 installdir/orangehrm directory and uncompress the new version of OrangeHRM to the same location.

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

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

Approach B: Self-contained Bitnami installations

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

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

      $ chown -R bitnami:daemon installdir/apps/orangehrm/htdocs/
      $ chmod -R 775 upgrader/ lib/ symfony/
  • Launch the upgrade wizard. Access it in the web browser by navigating to http://localhost/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:

      $ installdir/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