Project

General

Profile

Do we need to run db:migrate TWO times when migrating Redmine from one computer to another?

Added by Ashim Kapoor over 3 years ago

Hello everyone,

I wish to migrate Redmine from one computer to another. I could do some hit and trial and do this task,however I wish to confirm if my method was correct.

I am using Redmine-4.1.1 on a Debian 10 computer with rvm ruby-2.6.5.

I am referring to this guide:-

https://www.redmine.org/projects/redmine/wiki/HowTo_Migrate_Redmine_to_a_new_server_to_a_new_Redmine_version

The above says :-

We assume you already have a running Redmine on the New machine with a virgin database.
Import the saved database into Redmine, then migrate the database and restart Redmine:

  1. cd /root/redmine
  2. ./redmine_bak --restore
  3. cd /usr/share/redmine
  4. rake db:migrate RAILS_ENV=production
  5. touch /usr/share/redmine/tmp/restart.txt

My query is : To have a running Redmine I would have to setup Redmine as mentioned here:

https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_9

I did the following steps, except the last one( redmine:load_default_data)

cd /opt/redmine/redmine-3.4.11/config/
bundle install
bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data

So my query is : we have to run db:migrate TWO times to migrate redmine. 1. To setup the blank database and 2. to migrate the old data.

Do I understand correctly?

Many thanks,
Ashim


Replies (2)

RE: Do we need to run db:migrate TWO times when migrating Redmine from one computer to another? - Added by Bernhard Rohloff over 3 years ago

Hi Ashim,

AFAIK the db:migrate step is only needed if you also upgrade your Redmine version while moving it to another machine.
It has nothing to do with the migration of the application itself. As you already have version 4.1.1 installed I think there's no need for it.

Installing Redmine on your new machine and moving your old database to it is all you need to do in this regard. Although you could setup a new database on your new machine just to see if the installation is working, but this is an optional step.

Kind regards,
Bernhard

RE: Do we need to run db:migrate TWO times when migrating Redmine from one computer to another? - Added by Ashim Kapoor over 3 years ago

Dear Bernhard,

OK. Seems like I have misunderstood what db:migrate does.

Many thanks,
Ashim

    (1-2/2)