0

I'm trying to migrate a redmine 1.1.3 installation on mysql to redmine 3.3.0 on ubuntu 16.04 on another server.

redmine 3.3.0 was installed using apt. I was able to login and the installation looked ok.

I migrated the database using mysqldump and then tried to run this, but I'm getting an error:

sudo bundle exec rake db:migrate RAILS_ENV=production --trace
bundler: failed to load command: rake (/usr/local/bin/rake)
LoadError: cannot load such file -- /usr/share/rubygems-integration/all/specifications/bin/rake
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<top (required)>'

Can someone help with this please?

infused
  • 24,000
  • 13
  • 68
  • 78
Prashant Saraswat
  • 838
  • 1
  • 8
  • 20

1 Answers1

0

Answering my own question: Instead of the original command, the following command works:

sudo bundle exec /usr/bin/rake db:migrate RAILS_ENV=production

This led to the following error:

rake aborted!
Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

To resolve this:

sudo apt-get install mysql-client libmysqlclient-dev ruby-dev libgmp-dev  build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev autoconf libc6-dev ncurses-dev automake libtool
sudo gem install mysql2

I also updated /usr/share/redmine/GemFile and added this line below the initial gem declarations:

gem "mysql2"

Also, when you install redmine it gives you an option to configure a database. Select 'No'. If you chose, 'Yes' then you need to delete the database that redmine created during install process and create a database manually. The following lines assume that you created a backup of your old database and the dumpfile is called /home/ubuntu/redmine

mysql -u root -p
mysql> create database redmine2 DEFAULT CHARACTER SET utf8;
grant all on redmine2.* TO 'redmine'@'%' IDENTIFIED BY 'password';
mysql> connect redmine2
mysql> source /home/ubuntu/redmine

After this you will need to modify /etc/redmine/default/database.yml to update the name of the database/username/password

After all this, I started getting passenger errors while trying to access redmine URL. I had to undo the change in /usr/share/redmine/GemFile. There were some file permission issues as well. Hope this helps someone.

Prashant Saraswat
  • 838
  • 1
  • 8
  • 20