# Transfer tracker to another server

# In which case the tracker is transferred

  1. Frequent critical failures of the current server on installed tracker.

  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 a tracker for scaling funnels or testing new GEOs.

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

To migrate a tracker running version 10 or earlier, contact support.

# 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.

  1. Run screen
screen
1

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

  1. Run the command to create a dump
kctl transfers dump
1

WARNING

When creating a dump, it is important to pay attention to the terminal output — if there were errors in the process, they could affect the integrity of the dump. In the future, it will not be possible to restore the tracker in full from such a dump.

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

# Restoring tracker from an archive local copy

Restore the tracker from the local archive 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.

  1. Install the tracker on the server and upload the dump to the /var/lib/kctl-transfers directory.

  2. Run the following command:

kctl transfers restore
1
  1. The restoration will complete with the message:

Everything is restored

# If the Installation Method is not Approved

  1. Create an SQL dump of the database on the old server
mysqldump keitaro | gzip > dump.sql.gz
1
  1. Copy the SQL dump archive to the new server.

  2. Save the SALT and POSTBACK_KEY values from var/www/keitaro/application/config/config.ini.php of the old server

  3. Run on the new server

SALT=yoursalt POSTBACK_KEY=yourkey kctl transfers restore-from-sql local <PATH_TO_SQL_DUMP>
1
  1. Copy to the new server from the old server the folder with the lendings var/www/keitaro/lander/.

# Actions after tracker migration

  1. After a successful migration, you must bind the license key to the new server. To do this, first unbind it in your personal account on the keitaro.io website by following these instructions.

  2. Then, to direct traffic to the new server, update the DNS records for all domains by changing the A-record to the new server's IP address. The changes typically take effect within 24 hours.

# FAQ

How to restore from dump.gz (dump.sql)?

To restore a tracker from a database dump, use the kctl-transfer command with the restore-from-sql local action, for example:

SALT=test kctl-transfers restore-from-sql local path/to/dump.gz
1

On creating a dump in phpmyadmin, the language of the panel must be English.

What does **Could not detect TRACKER_POSTBACK_KEY** mean during migration?

This diagnostic message indicates that there is no custom postback key in the configuration. It can be ignored.