Free utility

Migrating RackMonkey data to Device42

We are happy to open-source the Rackmonkey to Device42 migration script. The script is available at github repository:

The script connects to your rackmonkey DataBase, get the data and sends it to Device42 appliance using the REST APIs.

Using this script, you can now migrate your rackmonkey data to Device42 in minutes. The requirements/how-to and gotchas etc. are discussed below.


RackMonkey v1.2.5-1
Device42 v5.7.1.1394099009 and above
python 2.7.x

You can run the script from any box that can connect to RackMonkey Database and Device42 via https. It could be the rackmonkey host itself or any other machine that satisfies the requirements.

To install MySQLdb, you need “MySQL-python” installed. On a base ubuntu 12.04 image, we had to do following. Your mileage may way depending on OS and version.

sudo apt-get install python-pip
sudo apt-get install libmysqlclient-dev
sudo apt-get install build-tools
sudo apt-get install python-dev
sudo pip install MySQL-python

How To

Once you have pre-requisites taken care of, take a look at the script in that repository. It is basically ready to go, all you have to do is add credentials and info for your Device42 appliance and your rackmonkey database.

Enter Device42 URL and credentials, where it says:

D42_API_URL = 'https://D42_IP_or_FQDN'           # make sure to NOT to end in /


Enter Rackmonkey Database and credentials, where it says


host = 'localhost'    # Hostname for RackMonkey DB. This and values below should be available in Rackmonkey config file
user = 'rackmonkey'   # Username to connect to DB
passwd = ''           # Password to connect to DB
dbname = 'rackmonkey' # DB Name

Please note that you can get this info from you rackmonkey config file if you forgot.

Optionally, you can change certain assumptions as used in the script. You can change the values from True to False or vice versa, depending on your needs.


DEBUG = False
CSV_ERRORS_FILE_NAME = 'rmerrors.csv'

Once the script is ready, you can do

chmod +x



As the script is running – all errors are logged in rmerrors.csv file (or the file name as set by CSV_ERRORS_FILE_NAME)

If successful, you should see your data in Device42.


  • If you have changed rackmonkey DB schema and customized the app to your need, you will need to adjust the script to send any additional data etc. Please refer to our API documentation or open a support ticket with us for any questions:
  • We are not doing any migration of rackmonkey apps in this script yet. If you use the rackmonkey app->device relationship capabilities, you can modify the script to add Application Components to Device42. However, because the rackmonkey relationships are all user-defined, a customized script is required for migration of applications. If you need help with migration of application data, feel free to reach out to us in support at and we will be happy to assist.
  • Also, since rackmonkey shows U # in the middle of slots in the rack layout, you will need to change a global setting in Device42 to make your rack looks the same. Go to Tools | Settings | Global Settings and change the “Rack Number between U’s option” to Start At.

Data Migration Help

If you don’t have enough resources to perform the migration yourself – we can do the migration for you. We will give you instructions on how to grab a DB dump and we can do the data conversion for you!

Share this post

About the author