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/08/17 20:06] – 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 34: | Line 34: | ||
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 " | + | Before your import the mysqldump databases into the new database, you need to create what I call a " |
- | CREATE DATABASE | + | CREATE DATABASE |
- | GRANT ALL ON newdatabase.* TO ' | + | CREATE USER tempuser@localhost IDENTIFIED BY ' |
+ | GRANT ALL PRIVILEGES | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
EXIT; | EXIT; | ||
- | CREATE USER ' | ||
- | GRANT ALL PRIVILEGES ON *.* TO ' | ||
| | ||
- | Now, you need to create databases | + | Now that you have created a temporary database |
- | + | ||
- | CREATE DATABASE restoreddb1 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; | + | |
- | GRANT ALL ON restoreddb1.* TO ' | + | |
- | + | ||
- | If there are others, then repeat the commands above for each one, replacing restoreddb1 | + | |
mysql -u newdatabaseuser -h localhost -p --database=newdatabase < / | mysql -u newdatabaseuser -h localhost -p --database=newdatabase < / | ||
Line 58: | Line 52: | ||
> EXIT | > EXIT | ||
- | If possibly, 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, restart the mysql service and reboot. | + | |
- | DROP DATABASE newdatabase; | + | That should be all there is to it! |
- | DROP USER ' | + | |
- | --- //[[netcmnd@jonathanhaack.com|oemb1905]] | + | --- //[[jonathan@haacksnetworking.org|oemb1905]] |
- | | + |