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:
Sign in to the machine where the Cyware Agent is installed.
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>
To go to the directory where the
.env
file of the Cyware Agent is located, run:cd <mount directory of Cyware agent>/conf/
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.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.
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>/
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
Create the
conf
directory in the mount directory of the agent using the following command:mkdir <mount directory of Cyware agent>/conf
Use the following command to create a
.env
file in theconf
directory.touch conf/.env
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.
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>
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
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