azureredmine-plus-agile

Upgrade Redmine+Agile

It is strongly recommended that you create a full 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.

Upgrade Redmine and all stack components

The recommended way to upgrade Redmine is to migrate all the data to a fresh Bitnami installation, which runs the updated version of Redmine.

On the original Redmine server, follow the steps below:

  • Create a database backup file named bitnami_redmine.sql:

    $ mysqldump -u root -p --databases bitnami_redmine --add-drop-database > bitnami_redmine.sql
    
  • Compress Redmine application and plugin files from the directory /opt/bitnami/apps/redmine/htdocs/files:

    $ tar czf redmine_files.tar.gz -C /opt/bitnami/apps/redmine/htdocs/files .
    $ tar czf redmine_plugins.tar.gz -C /opt/bitnami/apps/redmine/htdocs/plugins .
    

Launch a new Redmine server and follow the steps below:

  • Stop Apache:

    $ sudo /opt/bitnami/ctlscript.sh stop apache
    
  • Upload the file redmine_files.tar.gz to the new server.

  • Restore the database backup:

    $ mysql -u root -p < bitnami_redmine.sql
    
  • Copy the Redmine application files to /opt/bitnami/apps/redmine/htdocs/files, by copying redmine_files.tar.gz to the new instance and extract its contents:

    $ sudo tar xzf redmine_files.tar.gz -C /opt/bitnami/apps/redmine/htdocs/files
    
  • Temporarily give full write permissions to the Redmine log file:

    $ sudo chmod 666 /opt/bitnami/apps/redmine/htdocs/log/production.log
    
  • Migrate the database to the latest version:

    $ cd /opt/bitnami/apps/redmine/htdocs/
    $ sudo ruby bin/rake db:migrate RAILS_ENV=production
    
  • (Optional) If you had installed plugins in your previous installation, follow these steps:

    • Check that the plugins are compatible with the new version.
    • Copy the Redmine plugin files to /opt/bitnami/apps/redmine/htdocs/plugins, by copying redmine_plugins.tar.gz to the new instance and extracting it:

      $ sudo tar xzf redmine_plugins.tar.gz -C /opt/bitnami/apps/redmine/htdocs/plugins
      
    • Install the plugins:

      $ ruby bin/rake redmine:plugins RAILS_ENV=production
      
  • Clean the cache:

    $ ruby bin/rake tmp:clear
    
  • Revert the permissions of the Redmine log file:

    $ sudo chmod 644 /opt/bitnami/apps/redmine/htdocs/log/production.log
    
  • Start Apache:

    $ sudo /opt/bitnami/ctlscript.sh start apache
    

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 /opt/bitnami/apps/redmine/htdocs/
    $ ruby bin/rake db:migrate RAILS_ENV=production
    
Last modification May 31, 2019