Skip to main content

Cyware Orchestrate

Migrate Cyware Agent

If the Cyware Agent is installed on a machine, you can migrate it to another machine. This guide provides you with instructions on how to migrate Cyware Agent from one machine to another machine.

Before you Start 

Ensure that no playbooks are running on the Cyware Agent of the current machine.

Steps 

Cyware Agent migration is a two-step process:

Step 1: Copy the content of the .env file from the existing machine

Step 2: Migrate Cyware Agent to Another Machine  

Copy the content of the .env file from the Existing Machine

To copy the content of the .env file from the existing machine, follow these steps:

  1. Sign in to the machine where the Cyware Agent is installed.

  2. To go to the mount directory of your existing Cyware Agent, and run the following command on the machine where the agent is installed:

    cd <mount directory of Cyware agent>
  3. To go to the directory where the .env file of the Cyware Agent is located, run: 

    cd <mount directory of Cyware agent>/conf/
  4. Copy the content from the .env file to another machine where you want to migrate the Cyware Agent.

    The .env file contains all the configuration details of the Cyware Agent. Copy the content as you must use the same content from the .env file on the new machine to migrate the Cyware Agent.

  5. Disable the Cyware Agent from the existing machine using the following command:

    docker rm -f<agent docker conf id>
Migrate Cyware Agent to Another Machine

To migrate the Cyware Agent to another machine, follow these steps:

Note

Before you start, ensure that you have disabled the Cyware Agent from the existing machine.

  1. In the new machine where you want to migrate the Cyware Agent, create an agent directory using the following command:

    mkdir <mount directory of Cyware agent>/
  2. Go to the agent mount directory and create the apps and logs directories using the following commands:

    cd <mount directory of Cyware agent>
    mkdir <mount directory of Cyware agent>/apps/logs
  3. Create the conf directory in the mount directory of the agent using the following command:

    mkdir <mount directory of Cyware agent>/conf
  4. Use the following command to create a .env file in the conf directory.

    touch conf/.env
  5. Go to the .env file in the new machine using the following command. Paste the copied content from the .env file of the previous machine to the .env file of the new machine.

    vi conf/.env

    Note

    In the command, vi is used to open the Vim editor. You can use any other editor.

  6. After you copy the .env file to the new machine, and check for the Cyware Agent mount directory permissions using the following command. Replace <path_to_agent_mount_directory> with the actual directory path.

    chown -R 1000:1000 <path_to_agent_mount_directory>
  7. Run the following command to download the configure.sh file.

    wget https://packages.cyware.com/repository/cyware/soar/configure.sh

    Note

    If wget is not installed, then run the following command to install wget:

    sudo yum install wget
  8. Restart the Cyware Agent by running the following command:

    bash configure.sh MOUNT_DIRECTORY=<mount directory of Cyware agent> IMAGE=<Code engine Image> DOCKER_NAME=<docker container name> MODE=restart