Updated RackTables to Device42 Migration Script

The RackTables migration script was just updated, and is now even more powerful. It takes inventory information from your RackTables installation, and sends it to Device42’s via the RESTful API’s.

 

Has the time come to retire “RackTables”? If you’ve outgrown your RackTables installation and are moving up to Device42 to track and manage your infrastructure, you’re in the right place. The script is also handy if you’re a current RackTables user and looking to test drive Device42.

 

As long as the the script’s configuration file is set properly, the Device42 to RackTables migration script will do the hard work. You’ll be off to the races before you know it!

 

Script Changes:

  1. Switchport data is now migrated
  2. Patch Panels and Connections are now migrated
  3. PDU’s are now migrated

 

Prerequisites & Assumptions:

    1. A python 2.7.x installation is expected, along with the following libraries:
      1. pymysql [install with easy_install or pip]
      2. requests [install with easy_install or pip]
    2. The script works with Device42 v10.5.0 and newer.
    3. The script assumes you are running RackTables v0.20.7 or newer.
    4. RackTables and Device42 use different organizational concepts. You’ll need to configure the migration script options based on how you’ve been storing data in RackTables. Furthermore, one of the following needs to be set to TRUE, as Device42 requires that rooms be created, as racks can only go into rooms and not directly into buildings.
      1. CHILD_AS_BUILDING: RackTables uses location and sub-location, while Device42 uses Buildings and Rooms. If CHILD_AS_BUILDING is set to TRUE, sub-locations will become Rooms when migrated. If FALSE, sub-locations are migrated as Buildings.
      2. ROW_AS_ROOM: In RackTables, Rows are subordinate to locations (or sub-locations). Device42, as mentioned, uses Rooms. If ROW_AS_ROOM is set TRUE, Rows are migrated as Rooms. If FALSE, Rows are migrated as Rows.

 

Usage

  1. Create working directory. Copy files in Device42’s GitHub Racktables-to-Device42-Migration repo
  2. Copy (or move/rename, or create new) conf.sample to conf
  3. Set the required parameters in conf [D42 instance info & RackTables MySQL DB credentials]:
  4. # ====== Device42 upload settings ========= #
    D42_USER = 'device42 user'
    D42_PWD = 'device42 password'
    D42_URL = 'https:// device42 server IP address'
    * add RackTables DB info/credentials
    # ====== MySQL Source (Racktables) ====== #
    DB_IP = 'racktables server IP'
    DB_PORT = '3306'
    DB_NAME = 'racktables database name'
    DB_USER = 'racktables user'
    DB_PWD = 'racktables password'
    

     

  5. Run the script! [ $ python racktables2device42.py ]

 

Consult the README.MD file for more information.

 
 

A few “Gotchas”:

  • Devices without names aren’t migrated
  • PDU migration is still a work in progress
  • The order of the function calls in main() is important — DO NOT change unless you *really* understand all the nuances [e.g. subnets must be migrated before IP addresses for IP’s to populate the appropriate subnet]
  • If a patch panel has more than one port type, a modular patch panel will be created in Device42
  • The following are data length limits and will be truncated when migrated:
    • Maximum Port Type name length: 12
    • Maximum Hardware name length: 48
    • Maximum PDU type name length: 64

 

Grab a .zip of the new script or visit the repo. The updates should result in more complete data migration from Racktables to Device42.

 

If things aren’t working as you’d expect, and you’ve verified all prerequisites are met [and have read the ‘gotchas’!], please do let us know. The same holds true if you notice anything that may not have come up during our testing. We really do appreciate the feedback, positive or otherwise! If you aren’t currently a Device42 user … What are you waiting for!? Download Device42 today.