# Transfer tracker to another server

# In which case the tracker is transferred

  1. Frequent critical failures of the current server where the tracker is installed.

  2. Unsuitable functionality and pricing system.

  3. Not enough disk space and no possibility to increase it at your current cloud provider.

  4. Need to change the data center of the server and save statistics.

  5. Need to make a duplicate, copy of tracker for scaling funnels or testing new GEOs.

# The actual method of migrating a tracker to a new server

All commands are executed on the server to which you want to migrate.

  1. Log in to the server via SSH.

  2. Run the tracker installation script

curl keitaro.io/kctl.sh | bash -s -- install
1
  1. After tracker will be installed — run screen
screen
1

Processes running inside the screen are not interrupted when the connection to the server is broken.

  1. Start data migration from the old server to the new one with the command.
[SSH_PASSWORD=somepass] kctl transfers copy-from <OLD-SERVER-IP>
1

Where somepass is the ssh password to old server, OLD-SERVER-IP is the IP address of the old server

Example:

SSH_PASSWORD=123123 kctl transfers copy-from 111.12.19.19
1

If access to the server from which you want to migrate is possible only with a key — upload the key to the new server and run the script

SSH_PATH_TO_KEY="/path/to/my/ssh.private.key" kctl transfer copy-from OLD_SERVER_IP
1

All statistics and settings, including local landing pages, offers and user lists of bots and user agents are transferred automatically.

WARNING

Do not create campaigns, affiliate networks, and other entities in the new tracker until the migration process is complete. When the migration script finishes, the new tracker will contain only data from the old tracker.

TIP

Wait until the kctl transfer script finishes it's working and then start working with the new tracker.

# Creating an archive copy of the tracker locally

Create an archive copy of the tracker locally on the current server. Including MySQL data, ClickHouse data, system settings, local landing pages, salt, Postback key, SSL-certificates, filters, custom bot lists, etc.)

kctl transfers dump
1

Data will be saved in /var/lib/kctl-transfers and avaliable for downloading.

# Restoring tracker from an archive local copy

Restoring the tracker from local archoeve copy on the current server. Including MySQL data, ClickHouse data, system settings, local landing pages, salt, Postback key, SSL-certificates, filters, custom bot lists, etc.)

kctl transfers restore
1

Data will be taken from /var/lib/kctl-transfers