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 MySQL.
$ sudo /opt/bitnami/ctlscript.sh stop $ sudo /opt/bitnami/ctlscript.sh start mysql
Remove the previous database and create the new one. You can configure the database user password with a secure password.
$ mysql -u root -p Password: **** mysql> drop database bitnami_openproject; mysql> create database bitnami_openproject; mysql> grant all privileges on bitnami_openproject.* to 'bn_openproject'@'localhost' identified by 'DATABASE_PASSWORD';
Restore the new database:
$ mysql -u root -p bitnami_openproject < backup.sql
Edit the OpenProject configuration file at /opt/bitnami/apps/openproject/htdocs/config/database.yml to update the database user password to the one that set previously.
production: adapter: mysql2 database: bitnami_openproject host: localhost username: bn_openproject password: "DATABASE_PASSWORD" encoding: utf8
Migrate the database to the latest version:
$ cd /opt/bitnami/apps/openproject/htdocs $ ruby bin/rake db:migrate RAILS_ENV=production
Copy the /opt/bitnami/apps/openproject/htdocs/files folder from the old installation to the new one.
Finally, clean the cache and the sessions:
$ ruby bin/rake tmp:clear
Restart the servers and you can access the new OpenProject installation.
$ sudo /opt/bitnami/ctlscript.sh restart
If you see the following error, go to your database and remove the specified table and run the migrate command again.
Mysql::Error: Table 'changeset_parents' already exists: CREATE TABLE `changeset_parents` (`changeset_id` int(11) NOT NULL, `parent_id` int(11) NOT NULL) ENGINE=InnoDB $ mysql -u root -p mysql> use bitnami_openproject; mysql> drop table changeset_parents;
If you upgrade from a 1.x version and you see something similar to this error creating an issue:
MysqlStatement::Error Value for field `value` cannot be NULL INSERT INTO custom_value ...
Go to your custom values in the Admin panel, try to edit and save them again. This should fix the issue.