Thanks for answering my first question there. This isn’t the shortest of processes if you’ve never migrated a website manually before. While I’ll do my best to give step by step, my perspective is of someone who manages servers regularly, and I may overlook something that my mind skips over, something I instinctively assume doesn’t need to be said. I will do my best to provide the steps though.
- Have HostGator enable SSH (jailshell) for you.
This may require a support ticket. You just need them to run this on their server:
chsh -s /usr/local/cpanel/bin/jailshell cpanelusername
- Connect to their server using SSH.
Your cPanel username and password are the correct credentials for this.
- Get the database information. This should work:
grep "DB_" ~/public_html/wp-config.php
(That may vary if your Wordpress installation is in another folder)
Here’s an example of the details you’re looking for from that output:
define( 'DB_NAME', 'database_name_here' );
define( 'DB_USER', 'username_here' );
define( 'DB_PASSWORD', 'password_here' );
Dump the Wordpress database to a file. Using the details from step 3, change the appropriate values in this:
mysqldump -u username_here -p'password_here' database_name_here > ~/database_name_here.sql
SSH into your new LEMP (Linux, Nginx, MySQL, PHP) droplet.
Create database and user. Using same values from step 3 to change the necessary values:
create database database_name_here;
grant all on database_name_here to username_here identified by 'password_here';
Sync the files over from HostGator’s server to your droplet with us:
rm index.html -f
rsync -avz cpanelusername@gator####.hostgator.com:~/public_html/ .
rsync -avz cpanelusername@gator####.hostgator.com:~/database_name_here.sql .
(Change “cpanelusername” and “gator####.hostgator.com” to their appropriate values, as well as the databasenamehere value)
Import the database:
mysql database_name_here < /root/database_name_here.sql
Set file ownership:
chown -R www-data. /var/www
At this point you should be “done.” Every website is unique, especially with the wealth of plugins and configurations out there, so there may be other steps that you have to go through after this. You’ll have to take each problem as it comes and look for it’s solution individually, as one guide cannot reasonably account for all possible variables.