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: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, authenticate as root on the //old host// and backup your entire database. | + | 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 to dump the entire database: |
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 | ||
- | | + | |
+ | CREATE USER tempuser@localhost | ||
+ | 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 user -p | + | |
+ | |||
+ | 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. Now, it is time to migrate | + | After the database is migrated, simply copy all the files from web root for the instance over to the new host. Ensure that permissions and configuration files are appropriate, then reboot. Once the database |
- | scp -r / | + | DROP DATABASE temp; |
- | + | DROP USER ' | |
- | Put the files in the appropriate locations, obviously make sure you set up TLS again if needed and check file permissions for the directories, | + | |
- | --- //[[netcmnd@jonathanhaack.com|oemb1905]] | + | That should be all there is to it! |
- | + | ||
- | | + | --- //[[jonathan@haacksnetworking.org|oemb1905]] |