Today we will describe how to transfer Keitaro with all stats and settings to a new server.
We will need to create a database dump and use it during the installation.
IMPORTANT! The dump will have all the stats to the moment and all the campaigns and streams and the tracker’s settings, API keys, the list of domains, sources and partnership networks templates.
NOT INCLUDED to the dump:
- local landing pages and local offers (the archives);
- additional bot IP lists.
We will describe how to transfer landing pages, offers and ip lists below.
Preparing for creating a database dump
Upgrade Keitaro to the latest version. It’s important because the database for Keitaro v.8 or v.7 won’t work in Keitaro v.9.
After the upgrade is complete you can make a dump of Keitaro 9.
Note: in case you can’t update the tracker, contact our support team, we will provide the possible solutions.
You will need the following data for transfer:
- database name;
- database user name;
All these credentials are in an application/config/config.ini.php file which is located in Keitaro’s directory on a server.
Copy the file or its content in order not to lose the data.
How to create a database dump
We strongly recommend using a Terminal to create a dump via ssh connection. phpMyAdmin is a less reliable way of creating a dump.
In case you can’t create a dump via ssh, find the info about phpMyAdmin below.
Use the following code for creating a dump:
mysqldump -u USER -p DATABASE_NAME | gzip > dump.sql.gz
where USER is the DB username from a config file, and DATABASE_NAME is the DB name from a config file.
Next, insert the password – DB password from a config file and click Enter.
If you enter the correct values, the cursor in a terminal will stop blinking. It means the Terminal began to create a dump. After the dump is ready, Terminal will reply with a new line to enter the command.
Transferring a dump
After the dump is created it can be found either in a Keitaro’s directory on a server or in a /var folder.
Make sure the dump’s name doesn’t begin with a space – dump.sql.gz, not _dump.sql.gz.
Download a dump to a new server to a /var folder. You can either connect with SFTP or use a command in a terminal:
scp user@old_server:/root/dump.sql.gz /root/dump.sql.gz
The dump will be uploaded as /root/dump.sql.gz on a new server.
Installing a tracker using a dump
Run an installation process. When the installation will ask about a dump, reply “yes” and put the path to the dump, in our case it’s:
Next, you will be asked for a SALT. Take it from an application/config/config.ini.php file.
After the installation is complete, use your old login and password from your previous tracker to log in to Keitaro.
Important! Go to Maintenance > Status and click “Reload Cache”.
Error: you can’t log in
You need to reset the password.
Pdo error while trying to log in
In case you see the following error:
pdo error: [1146: Table ‘keitaro_settings’ doesn’t exist] in EXECUTE(«SELECT * FROM keitaro_settings as t»)-
open config.ini.php from an old tracker and copy the content of a Prefix for tables prefix line to a new config.ini.php file on a new server.
Creating a dump with phpMyAdmin
Add phpmyadmin/index.php to your server’s ip and log in to phpMyAdmin:
Go to Export tan in phpMyAdmin, change nothing and click OK.
The dump will be downloaded to your local disk.
Click “Choose file” and select a dump on your local disk.
How to transfer local landing pages and offers
This data is transferred manually. All uploaded archives are located in a “landers” folder by default:
In case you changed the folder’s name go to your Landing Pages in Keitaro and check the folder’s name:
Copy the folders from an old server and paste them to a new one.
How to transfer additional bots IP lists
These IP lists are located in the following directory:
Download the files from the old server and upload them to a new server to the same directory.