This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
computing:migratewp [2019/02/18 05:45] – created oemb1905 | computing:migratewp [2022/07/31 17:42] – oemb1905 | ||
---|---|---|---|
Line 11: | Line 11: | ||
------------------------------------------- | ------------------------------------------- | ||
- | This tutorial is designed to step one through how to migrate a self-hosted Word Press site manually. First, | + | This tutorial is designed to step one through how to migrate a mysql database to another host. First, |
sudo -i | sudo -i | ||
Line 30: | Line 30: | ||
> mysqldump-all-databases.sql | > mysqldump-all-databases.sql | ||
- | The spacing is optional and thanks | + | Use scp to get the file to the new host: |
+ | |||
+ | sudo scp mysqldump-all-databases.sql user@newhostorip.com: | ||
+ | |||
+ | Before | ||
- | | + | |
+ | GRANT ALL ON newdatabase.* TO ' | ||
+ | FLUSH PRIVILEGES; | ||
+ | EXIT; | ||
+ | CREATE USER ' | ||
+ | GRANT ALL ON newdatabase.* TO ' | ||
| | ||
- | This will take some time. Once it finishes, log into the mysql command mode and verify | + | Now, you need to create databases |
- | mysql -u user -p | + | |
+ | GRANT ALL ON restoreddb1.* TO ' | ||
+ | |||
+ | If there are others, then repeat the commands above for each one, replacing restoreddb1 with the name of the databases you are importing and bringing in. Now, time to import that database into the new host: | ||
+ | |||
+ | mysql -u newdatabaseuser -h localhost -p --database=newdatabase < / | ||
+ | |||
+ | Once it finishes, log into the mysql command mode and verify the original databases made it over: | ||
+ | |||
+ | sudo mysql -u user -p | ||
> SHOW DATABASES; | > SHOW DATABASES; | ||
> EXIT | > EXIT | ||
- | Run this command on both machines, and the output should be identical. | + | If possibly, run this command on both machines, and the output should be identical. |
- | scp -r / | + | |
| | ||
- | Put the files in the appropriate locations, | + | Put the files in the appropriate locations, |
- | --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2019/02/17 22:06// | + | DROP DATABASE newdatabase; |
- | | + | DROP USER ' |
+ | |||
+ | --- //[[jonathan@haacksnetworking.com|oemb1905]] 2019/12/30 02:37// | ||
| |