This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
computing:migratewp [2019/06/16 05:50] – oemb1905 | computing:migratewp [2022/07/31 17:48] – oemb1905 | ||
---|---|---|---|
Line 11: | Line 11: | ||
------------------------------------------- | ------------------------------------------- | ||
- | 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 [[https:// | + | This tutorial is designed to step one through how to migrate a mysql database to another host. The tutorial is named migratewp, because I first did this on a WP instance. First, use mysqldump |
sudo -i | sudo -i | ||
Line 33: | Line 33: | ||
| | ||
sudo scp mysqldump-all-databases.sql user@newhostorip.com: | sudo scp mysqldump-all-databases.sql user@newhostorip.com: | ||
+ | | ||
+ | Before your import the mysqldump databases into the new database, you need to create what I call a " | ||
- | Now, time to import that database into the new host: | + | CREATE DATABASE temp; |
- | + | | |
- | | + | GRANT ALL PRIVILEGES ON temp.* to tempuser@localhost IDENTIFIED BY ' |
+ | FLUSH PRIVILEGES; | ||
+ | EXIT; | ||
| | ||
- | This will take some time. Once it finishes, log into the mysql command mode and verify the databases made it over: | + | Now that you have created a temporary database and database user with full privileges, it is time to import the backup. |
+ | |||
+ | mysql -u newdatabaseuser -h localhost -p --database=newdatabase < / | ||
+ | |||
+ | Once it finishes, log into the mysql command mode and verify the original | ||
sudo mysql -u user -p | sudo mysql -u user -p | ||
Line 44: | Line 52: | ||
> EXIT | > EXIT | ||
- | Run this command on both machines, and the output should be identical. | + | After the database |
- | sudo scp -r / | + | DROP DATABASE temp; |
- | + | DROP USER ' | |
- | 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. | + | |
- | --- //[[netcmnd@jonathanhaack.com|oemb1905]] | + | That should be all there is to it! |
- | | + | |
+ | --- //[[jonathan@haacksnetworking.org|oemb1905]] |