Haacking-Club/WordPress

--- * **migratewp** * **Jonathan Haack** * **Haack's Networking** * **netcmnd@jonathanhaack.com**

---

//migratewp//

---

This tutorial is designed to step one through how to migrate a self-hosted Word Press site manually. First, completely set up LAMP and TLS and DNS, etc., before you begin migration, and review [|Apache Survival] if you are unclear on how to do that. Now, once that is set up, authenticate as root on the //old host// and backup your entire database (thanks to @jjscha for this mysqldump syntax):

sudo -i /usr/bin/mysqldump   \ --add-drop-database \ --all-databases    \ --allow-keywords   \ --comments         \ --complete-insert  \ --lock-all-tables  \ --skip-dump-date   \ --events           \ --flush-logs       \ --flush-privileges \ --hex-blob         \ --opt              \ --routines         \ > mysqldump-all-databases.sql

Use scp to get the file to the new host: sudo scp mysqldump-all-databases.sql user@newhostorip.com:

Now, time to import that database into the new host:

mysql -u user -h localhost -p < /path/to/mysqldump-all-databases.sql This will take some time. Once it finishes, log into the mysql command mode and verify the databases made it over:

sudo mysql -u user -p > SHOW DATABASES; > EXIT

Run this command on both machines, and the output should be identical. Now, it is time to migrate the website //files// over to the new host:

sudo scp -r /var/www/website.com/public_html user@newhostorip.com:/var/www/newwebsite.com/ Put the files in the appropriate locations, and that should be it. Definitely reboot, and I have found it is helpful to restart the router, modem, and workstations on the network. If the old host is on the same network, this is helpful.

--- //oemb1905 2019/06/15 23:42//