nativeInstallerredmine

Upgrade Redmine

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.

NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.

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. Depending on your installation type, execute the following commands:

    • Approach A (Bitnami installations using system packages):

        $ cd installdir/redmine
      
    • Approach B (Self-contained Bitnami installations):

        $ cd installdir/apps/redmine/htdocs/
      
  • Copy Redmine application and plugin files from the files directory. You can compress the directories into the temporary backup folder in Linux and macOS with the commands below:

      $ 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 installdir/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. Depending on your installation type, execute the following commands:

    • Approach A (Bitnami installations using system packages):

        $ cd installdir/redmine
      
    • Approach B (Self-contained Bitnami installations):

        $ cd installdir/apps/redmine/htdocs/
      
  • Copy the Redmine application files to the files directory. In Linux and macOS, copy redmine_files.tar.gz to the new instance and extract its contents:

      $ sudo tar xzf redmine_files.tar.gz
    
  • 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 directories from the vendor/plugins directory into the new installation area, in the plugins directory. In Linux and macOS, copy redmine_plugins.tar.gz to the new instance and extract:

         $ 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
    
  • Start Apache:

      $ sudo installdir/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. Depending on your installation type, execute the following commands:

    • Approach A (Bitnami installations using system packages):

        $ cd installdir/redmine
      
    • Approach B (Self-contained Bitnami installations):

        $ cd installdir/apps/redmine/htdocs/
      

    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 August 31, 2021