- Re-think about your budget. Cpanel and Installatron cost quite much. The remain cost should be the VPS running cost itself. So surely 30$/month for a shared host should be a bargain.
- Carefully choose the host. Once you migrate it, you'll get into tons of workload.
- Think about the OS of the new host. I choose CentOS 7 for security reason.
- Think about the host provider. It seems like both linode and digitalocean provides good one. But let's see what I can do with linode.
- Setup VPS software: I need cpanel, installatron for website expansion. I also need to create nginx tab to redirect my traffics to different folder. I also want to setup package XYX,... on my OS. So, take time to finish it before migrate the website.
- Synchronize the file resources: I choose `rsync` to synchronize source code, upload files and other files from my old website. You can choose scp instead. The good thing is `rsync` helps maintain soft link and hard links. Bad thing is that using `rsync` incorrectly would lead to time consuming because you need to check again what files are missing.
- Synchronize the database: this would be the most difficult step. After download the database from the source website, you cannot only simply import it to the destination SQL database. At least you should check the path that database contain. This step is why nobody want to migrate the whole system from host to another host.
- Test the new website: Everything seems ok. But you need to check before point the domain to the new server.
Step 1 seems easy.
Cpanel & Installatron take me few steps to install. I also create ssh tunnel to access my VPS and secure my server using ssh key pair. Don't forget this, because after one night, the host would easily be taken down by some gangs :) for sure!Step 2 also easy.
I need to change modification mode of the new server's folder, let's say /home/user/public_html/ from 754 to 765 and use `rsync` at push method to synchronize files from the old server.Here's the point: the old server want to secure the website, so no one outside has permission to modify the files. The same with the new server. That's why I need to change permission of the new server's destination folder. Then I tunnel to my old server and push files from this one to the new server:
`rsync -auHxv old_destination_path/* user@newserver_IP:new_destination_path/`
the -auHxv is what you'll see in the document of `rsync`. Just simply check in terminal `rsync --help`
Step 2 done!
Step 3 - shit!
Use some advanced text editor like vim will fasten this step. In the database, there would be some hard link like "path_in_the_old_server" and we need to make sure this will be coordinate with the new server. Change all of it!After changing the database table, you can import it using phpadmin tool.