# Transfer tracker to another server
# In which case the tracker is transferred
Frequent critical failures of the current server on installed tracker.
Unsuitable functionality and pricing system.
Not enough disk space and no possibility to increase it at your current cloud provider.
Need to change the data center of the server and save statistics.
Need to make a duplicate, copy of a 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.
Log in to the server via SSH.
Run the tracker installation script
curl keitaro.io/kctl.sh | bash -s -- install
- After the tracker will be installed — run
screen
screen
Processes running inside the screen are not interrupted when the connection to the server is lost.
- Start data migration from the old server to the new one with the command
[SSH_PASSWORD=somepass] kctl transfers copy-from <OLD-SERVER-IP>
Where somepass
is the ssh password to the 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
If the server works with a specific port, use the command:
SSH_PORT=port SSH_PASSWORD=password kctl transfers copy-from s.e.r.v.e.r.i.p
Example:
SSH_PORT=3333 SSH_PASSWORD=123123 kctl transfers copy-from 111.12.19.19
If the access to the server from which you want to migrate is possible only with a key — add 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
All statistics and settings, including local landing pages, offers, user lists of bots, and user agents are transferred automatically.
- Go to your account on the website Keitaro.io, tab Licenses, and press Unlink for the license key that you want to bind to the new tracker. Then enter this key when logging in to the new tracker.
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 and 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.
- Run
screen
screen
Processes running inside the screen are not interrupted when the connection to the server is lost.
- Run the command to create a dump
kctl transfers dump
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.
# 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
On creating a dump in phpmyadmin, the language of the panel must be English.
# 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.
kctl transfers restore
Data will be taken from /var/lib/kctl-transfers
# If the Installation Method is not Approved
- Create an SQL dump of the database on the old server
mysqldump keitaro | gzip > dump.sql.gz
Copy the SQL dump archive to the new server.
Save the SALT and POSTBACK_KEY values from
var/www/keitaro/application/config/config.ini.php
of the old serverRun on the new server
SALT=yoursalt POSTBACK_KEY=yourkey kctl transfers restore-from-sql local <PATH_TO_SQL_DUMP>
- Copy to the new server from the old server the folder with the lendings
var/www/keitaro/lander/
.