Exporting Connections

Exporting Connection Data from Keeper Connection Manager

Overview

This document describes one method of exporting connection data along with connection parameters to a JSON file using a supplied Python script. The resulting file can then be used import connections to another Keeper Connection Manager instance (as documented here) or for migration to the Keeper Connection Manager (Cloud) version.

The example provided in this document is based on the standard Auto Docker Install method of Keeper Connection Manager, using a MySQL database.

Step 1: Open MySQL port to local machine

In order for the python file to query the database from within the Docker container, edit the /etc/kcm-setup/docker-compose.yml file and add the "ports" section to the "db" container as displayed below:

db:
        image: keeper/guacamole-db-mysql :2
        restart: unless-stopped 
        environment:
            ACCEPT EULA: "Y"
            GUACAMOLE_DATABASE: "guacamole_db"
            GUACAMOLE_USERNAME: "guacamole_user"
            GUACAMOLE_PASSWORD: "XXXXXXXXXXXXXXXXXXXXXXXXX"
            GUACAMOLE_ADMIN_PASSWORD: "XXXXXXXXXXXXXXXXXXXXXXXXX"
            MYSQL_ROOT_PASSWORD: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        ports:
            - "3306:3306"            

To apply the Docker Compose update, follow these steps:

  1. If using the auto-docker install, navigate to the location where the kcm-setup.run script is stored and execute:

  2. For Docker Compose installation, navigate to the folder /etc/kcm-setup and run:

Step 2: Install Python modules

Assuming your instance already has Python3, install the necessary Python modules:

To install python3-pip on your system, use the appropriate command for your operating system:

CentOS/RHEL 8 and newer:

CentOS/RHEL 7 and earlier:

Ubuntu:

Step 3: Create the export script

Copy and paste the below code into a file called export.py and place it on the Keeper Connection Manager instance, perhaps in the same location as your kcm-setup.run file. This Python script performs the following:

  • Locates the docker-compose.yml file in the standard /etc/kcm-setup/ folder

  • Pulls the MySQL/POSTGRES credentials and connects to the database

  • Exports the connection information and creates a file called export.json in the same folder

Depending on your environment, you may need to edit the file.

To execute the script, type:

This will produce a file called export.json in the local folder.

Notes

  • The "groups" object refers to User Groups

  • The "group" object refers to the Connection Group location

  • When importing this into another KCM instance, the connections will only import successfully if the Connection Group exists in the target

Last updated

Was this helpful?