2021年9月14日 星期二

Upgrade Redmine from Windows Server 2008 R2 to Debian 4.19 step by step

In this topic I introduce an easier way to migrate Redmine from Windows Server 2008 R2 to Debian 4.19. In the meanwhile, we also do the upgrading Redmine from 3.2.2 to 4.4.2. The environment to install Debian 4.19 is ESXi 6.5.0.

I would like to separate this article as three parts: 

  1. Backup
  2. Deployment
  3. Migrate
  4. Reference

BACKUP

  • Backup the database from Windows Server 2008 R2 using the command: 
    • $mysqldump -u root -p bitnami_redmine > bitnami_redmine_backup.sql
  • Backup the files that attached inner each issues from Windows Server 2008 R2. The path to store the attachments is usually under C:\Bitnami\redmine-3.2.2-0\apps\redmine\htdocs\files

DEPLOMENT

  • Backup the database from Windows Server 2008 R2 using the command: 
    • $mysqldump -u root -p bitnami_redmine > bitnami_redmine_backup.sql
  • Backup the files that attached inner each issues from Windows Server 2008 R2. The path to store the attachments is usually under <REDMINE_ROOT>\htdocs\files
  • To import OVA file into ESXi, you can do it as following steps 
    1. Click "Create/Register VM".
    2. Click "Deploy a virtual machine from an OVF or OVA file".
    3. Select where the OVA file that you download and give a name to register this VM.
    4. Select the datastore where you want to deploy.
    5. Chose the deployment options. For more flexible disk size usage  I recommend to chose "Thin" as disk provisioning. 
    6. Then click "Finish" and waiting for ESXi to finish the deployment.
  • Power on bitnami-redmine-4.2.2-5-r01-linux-debian-10-x86_64-nami and login.
  • You can find the necessary default login information in the boot log:
    • The IP for this VM.
    • The account and password for login console are both "bitnami"
    • The administrator account and password for login redmine and mysql.
    • After login, remember to  modify these password and add another administrator account for VM, redmine and mysql.
  • When you enter the IP address in a browser and you can find redmine is already installed and well performaning.
  • If you want to start sshd you may find the error message as following picture. Just remove the file /etc/ssh/sshd_not_to_be_run and start sshd again, and sshd should be working normally.


MIGRATE
  • Import the mysql using the following command:
    • $sudo mysql -u root -p database_name < file.sql
  • Migrate the product using rails
    • $cd /opt/bitnami/redmine
    • $rake db:migrate RAILS_ENV=production //remember do not run rails as "sudo"
  • Once execute rails you may find following errors:
    • Index name 'index_issues_on_parent_id' on table 'issues' already exists
      • $sudo mysql -u root -p 
      • use bitnami_redmine;
      • ALTER TABLE issues DROP INDEX index_issues_on_parent_id;
    • Errno::EACCES: Permission denied @ rb_sysopen - /opt/bitnami/redmine/db/schema.rb
      • $sudo chmod a+x /opt/bitnami/redmine/db/schema.rb


  • If you find some errors related "schema.rb" after execute rails , and you can change the owner of db/schema.rb as bitmani. And doing rails again.
  • Copy the backup files into /bitnami/redmine/files/, and then remember to change owner and group as "daemon".

REFERENCE
With this case, it is a good practice to create a new redmine server and migrate data from the old one.


OTORI
9/14/2021

沒有留言:

張貼留言