Redmine Restore

Added by Brian Rose about 6 years ago

I have a Redmine 2.3.3.stable server running on CentOS 6.2 and PostGreSQL. I want to move this to an Ubuntu 16.04.04 LTS server running Redmine 3.2.1.stable and I am getting some issues.

A few notes:

  1. I don't know the process used to install the existing server. It was set up by an admin who no longer works here. As I understand he had to build a lot of tools because that particular CentOS did not ship with them.
  2. I set up Redmine on Ubuntu by using apt. The motivation here is to have the system be able to keep itself up to date as much as possible and minimize the amount of development work.

I am trying to take the old database and import it into the new system and I am getting issues. Below are the steps I have used to try an migrate Redmine.

1. Create the new database in PostGreSQL

postgres=# CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=postgres;

Notes: Apt creates a 'redmine_default' database with the postgres owner. I tried changing the owner to redmine/instances/default, but that did not solve the issue.

2. Import the old database into the new one.

$ sudo -u postgres psql redmine < postgres_backup.sql

3. Copy the files into the new Redmine

$ tar -xf redmine_files.tar /usr/share/redmine/files

4. Point Redmine to the new database

$ sudo vi /usr/share/redmine/config/database.yml

  adapter: postgresql
    #  database: redmine_default
    database: redmine
    host: localhost
    # username: redmine/instances/default
    username: postgres
    password: <password>
    encoding: utf8

5. Migrate the database

$ cd /usr/share/redmine
$ rake db:migrate RAILS_ENV=production

Which is where I get the following error. If I am reading this correctly, this is the password for reading the database. Now I am running this as a personal account - say jsmith. But the Redmine system uses a different username.

What is the proper remedy for this? I have thought of the following potential solutions.

1. Add a jsmith user to PostGRESQL
2. Add a redmine user to the system
3. add a redmine user to PostGRESQL
4. sudo -u redmine rake db:migrate RAILS_ENV=production

[!] There was an error parsing `Gemfile`: Permission denied @ rb_sysopen - config/database.yml. Bundler cannot continue.

 #  from /usr/share/redmine/Gemfile:66
 #  -------------------------------------------
 #  end.each do |database_file|
 >    database_config = YAML::load(
 #    adapters = {|c| c['adapter']}.compact.uniq
 #  -------------------------------------------