Upgrade Redmine+Agile

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.

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

You can upgrade the application and the stack components by following the steps below:

  • Launch a new Redmine server.
  • Copy the database backup to the new server.
  • Stop all servers and start only MySQL.

    $ sudo installdir/ stop apache
    $ sudo installdir/ stop mysql
    $ sudo installdir/ start mysql
  • Remove the previous database and create the new one. You can configure the database user password with a secure password. Remember to add the -h option to specify the hostname if your database is hosted on a different server.

    $ mysql -u root -p
    Password: ****
    mysql> drop database bitnami_redmine;
    mysql> create database bitnami_redmine;
    mysql> grant all privileges on bitnami_redmine.* to 'bn_redmine'@'localhost' identified by 'DATABASE_PASSWORD';
  • Restore the new database:

    $ mysql -u root -p bitnami_redmine < backup.sql
  • Edit the Redmine configuration file to update the database user password (the same that you set previously) at installdir/apps/redmine/htdocs/config/database.yml.

        adapter: mysql2
        database: bitnami_redmine
        host: localhost
        username: bn_redmine
        password: "DATABASE_PASSWORD"
        encoding: utf8
  • Migrate the database to the latest version:

    $ cd installdir/apps/redmine/htdocs/
    $ ruby bin/rake db:migrate RAILS_ENV=production
  • If you have installed plugins in the previous version, copy the directories from the vendor/plugins directory into the new installation area, in the plugins directory. Check that the plugins are compatible with the new version and run the following command:

    $ ruby bin/rake redmine:plugins RAILS_ENV="production"        
  • Copy the installdir/apps/redmine/htdocs/files directory from the old installation to the new one.

  • Clean the cache and the sessions:

    $ ruby bin/rake tmp:cache:clear
    $ ruby bin/rake tmp:sessions:clear
  • Restart the servers:

    $ sudo installdir/ restart

Troubleshooting upgrades

  • If you see the following error, go to your database and remove the specified table and run the migration 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

    Run these commands:

    $ mysql -u root -p
    mysql> use bitnami_redmine;
    mysql> drop table changeset_parents;
    $ cd installdir/apps/redmine/htdocs/
    $ ruby bin/rake db:migrate RAILS_ENV=production
  • If you upgrade from a 1.x version and you see something similar to this error:

    MysqlStatement::Error Value for field `value` cannot be NULL INSERT INTO custom_value ...

    Go to your custom values in the admin panel, edit and save them again to fix the issue.

Last modification November 30, 2018