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:
This should give you a key like:
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.