awsopenproject

Upgrade OpenProject

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.

Follow these steps to only upgrade the application code without modifying any other stack components:

  • Launch a new OpenProject instance or server.

  • Copy the database backup to the new server.

  • Stop all servers and start only PostgreSQL.

      $ sudo /opt/bitnami/ctlscript.sh stop
      $ sudo /opt/bitnami/ctlscript.sh start postgresql
    
  • Remove the previous database and create the new one. You can configure the database user password with a secure password.

      $ psql -U postgres
      Password: ****
      postgres=# drop database bitnami_openproject;
      postgres=# create database bitnami_openproject;
      postgres=# grant all privileges on bitnami_openproject.* to 'bn_openproject'@'localhost' identified by 'DATABASE_PASSWORD';
    
  • Navigate to the OpenProject installation directory. Execute the following commands, depending on your installation type:

    • Approach A (Bitnami installations using system packages):

        $ cd /opt/bitnami/openproject
      
    • Approach B (Self-contained Bitnami installations):

        $ cd /opt/bitnami/apps/openproject
      
  • Restore the new database:

      $ psql -U postgres bitnami_openproject < backup.sql
    
    • Edit the OpenProject configuration file at config/database.yml to update the database user password to the one that set previously.

        production:
          adapter: postgresql
          encoding: unicode
          database: bitnami_openproject
          pool: 20
          username: bn_openproject
          password: "DATABASE_PASSWORD"
          host: localhost
      
  • Migrate the database to the latest version:

      $ bundle exec rake db:migrate RAILS_ENV=production
    
  • Copy the files folder, located in the OpenProject installation directory, from the old installation to the new one.

  • Finally, clean the cache and the sessions:

      $ bundle exec rake tmp:clear
    
    • Restart the servers and you can access the new OpenProject installation.

      $ sudo /opt/bitnami/ctlscript.sh restart
      
Last modification September 27, 2022