Moving From Windows to Linux

If you are moving from a Windows server to a Linux server, especially from running an older version of RhodeCode Enterprise pre 2.x, use the following information to successfully migrate your instances and database.

Overview

  • Install RhodeCode Control on your Linux server, use the RhodeCode Control Docs to guide you through this.
  • Copy your repositories directory to the Linux server.
  • Copy your original rhodecode.ini file to the Linux server, named production.ini in older versions, and make a minor edit to point to the copied database.
  • Copy your original instance database and update Windows paths to Linux paths pointing to your repositories directory.
  • Use RhodeCode Control to import and upgrade your RhodeCode Enterprise instance, using the copied and edited file and database.

Pre-requisites

  • For MySQL, do not use localhost in the database connection string of the rhodecode.ini file.
  • InnoDB must be the database tables engine.
  • Contact RhodeCode for a new licence Key/Token pair. If you don’t, a trial licence will be applied so you are not locked out of the upgraded instance.

You can find the specific instructions to carry out these pre-requisite steps in the RhodeCode Control upgrade docs.

Configuration File Update

Configure the copied rhodecode.ini file to connect to your copied database. Use the following steps:

  1. Open the copied rhodecode.ini file.
  2. When you open the file, find the database configuration section, and use the below example to change the connection details:
#########################################################
### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG    ###
#########################################################

# Point to copied DB
sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode.db.copy
sqlalchemy.db1.url = mysql://root:qweqwe@127.0.0.1/rhodecode.db.copy

Database Update

Update the Windows paths in the rhodecode.rhodecode_ui database tables. To do this log into the database and reset the file paths to Unix format. One login option is to use iShell, see usage examples in the Settings Management section.

In [28]: from rhodecode.model.settings import SettingsModel
In [29]: paths = SettingsModel().get_ui_by_section('paths')
In [30]: paths[0].value = '/home/user/repos'
In [32]: Session().add(paths[0])
In [33]: Session().commit()

Import and Upgrade

Once you have made your changes, use RhodeCode Control to import and upgrade your RhodeCode Enterprise instance to the latest version.

# Import original instance as explained above
$ rccontrol import Enterprise path/to/rhodecode.ini

# Install a VCS Server as explained above
$ rccontrol install VCSServer

# Check the status of them
$ rccontrol status

 - NAME: enterprise-1
 - STATUS: RUNNING
 - TYPE: Enterprise
 - VERSION: 1.5.0
 - URL: http://127.0.0.1:10000

 - NAME: vcsserver-1
 - STATUS: RUNNING
 - TYPE: VCSServer
 - VERSION: 3.5.0
 - URL: http://127.0.0.1:10001

# Upgrade from version 1.5.0 to 3.5.0
$ rccontrol upgrade enterprise-1 --version 3.5.0

Checking for available update for enterprise-1 @ 1.5.0
Stopped enterprise-1
Initiating upgrade to version 3.5.0
...
****************************************
*** UPGRADE TO VERSION 45 SUCCESSFUL ***
****************************************

Note that RCE 3.x requires a new license please contact support@rhodecode.com

Upgrade of RhodeCode Enterprise successful.
Auto starting enterprise-1

Post Migration Tasks

  • From the RhodeCode Enterprise Admin ‣ Settings ‣ VCS page, check that the Repositories Location is correctly pointing to your repositories.
  • Remap and rescan repositories so that the new instance picks them up, see Remap and Rescan Repositories.