vmware-marketplaceredmine

Upgrade Redmine

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 temporary folder for the backup:

      $ mkdir /tmp/redmine-backup
    
  • Create a database backup file named bitnami_redmine.sql in the temporary backup folder:

      $ mysqldump -u root -p --databases bitnami_redmine --add-drop-database > /tmp/redmine-backup/bitnami_redmine.sql
    
  • Navigate to the Redmine installation directory:

      $ cd /opt/bitnami/redmine
    
  • Compress Redmine application and plugin files from the files directory into the temporary backup folder:

      $ tar czf /tmp/redmine-backup/redmine_files.tar.gz files
      $ tar czf /tmp/redmine-backup/redmine_plugins.tar.gz 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
    
  • Navigate to the Redmine installation directory:

      $ cd /opt/bitnami/redmine
    
  • Copy the Redmine application files to the files directory, by copying redmine_files.tar.gz to the new instance and extracting its contents:

      $ sudo tar xzf redmine_files.tar.gz
    
  • Temporarily give full write permissions to the Redmine log file:

      $ sudo chmod 666 log/production.log
    
  • Migrate the database to the latest version:

      $ bundle exec 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 the plugins directory, by copying redmine_plugins.tar.gz to the new instance and extracting it:

         $ sudo tar xzf redmine_plugins.tar.gz
    
  • Install the plugins:

         $ bundle exec rake redmine:plugins RAILS_ENV=production
    
  • Clean the cache:

      $ bundle exec rake tmp:clear
    
  • Revert the permissions of the Redmine log file:

      $ sudo chmod 644 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
    

    First, navigate to the Redmine installation directory:

      $ cd /opt/bitnami/redmine
    

    Then, run these commands:

      $ mysql -u root -p
      mysql> use bitnami_redmine;
      mysql> drop table changeset_parents;
    
      $ bundle exec rake db:migrate RAILS_ENV=production
    
Last modification February 9, 2023