Matomo Analytics

Whether you're coming from an old host, or your wanting to move all your sites to a new server, migration sounds hard but really isn't that hard.

In this guide, we'll describe you how to easily manage this with rsync.

We'll start with your old server, we're going to need to find the public key to be added to your new server. Log into SSH into your old server as the user that runs the websites.

Run this command to get that:

cat ~/.ssh/id_rsa.pub

This should give you a key like:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD4SNuSYi5uaLNVjEGMbE2....

Grab that key, and add that key to your new server via the authorized_hosts file inside ~/.ssh/authorized_hosts, with Ploi you can easily add this key via the UI:

Now make sure the new server has the domain already created that you want to migrate over. It is also advised the folder in the new server is empty for that domain

And then we're going to run the command on the old server to rsync everything over:

cd /home/ploi/domain.com

rsync -rt * [email protected]:/home/ploi/domain.com

The flags mean the following:

  • r means recursive, we want each subdirectories & files as well
  • t means preserve modification times

The wildcard * means grab anything in the folder we cd'ed into.

More information on the flags for rsync can be found here.

26 June 2021 (last updated 3 years ago)

3591 views

Written by Dennis

Dennis brings over 6 years of hands-on experience in server management, specializing in optimizing web services for scalability and security.

Back to Domains


Start free trial