Very recently, we published an article about moving entire website from one server to another via SSH. Sometimes those commands give us problems with the resulting transfer, so we found this alternate method that seems to work perfectly.
Keep in mind, you MUST perform separate actions for copying or moving databases as well as adding email addresses.
1. First log in to your old server via SSH. If necessary, you may need to login as a “super user”.
2. Change directories to the directory where your website resides.
3. Type in the following code:
4. tar -cpzf backup.tar.gz *
6. This creates a tar file of all files in that directory.
7. Login to your new server.
8. Navigate to the directory where you want to place the website you are moving.
7. Type in:
8. wget yourdomain.com/backup.tar.gz
9. (Of course, yourdomain.com is replaced with your actual domain name). This transfers the tar file from the old server to the new server.
10. Once the file is transfered, type:
10. tar -xzf backup.tar.gz
11. This will unpack the tar file onto the new server in the directory that you placed it.
That’s it, another way to move websites using SSH.