How to migrate wordpress website

If you use cPanel

1, open cPanel in your old server/hosting ->backup->Download a Home Directory Backup->Download a MySQL Database Backup->Download Email Forwarders.
2, open cPanel in your new server -> backup->upload backups
3, go to mysql to create a new user and password
4, Edit the wp-config.php to update the new database name and account

If you don't use cPanel

1, backup the whole site (full backup)
   (optional): database-->phpMyAdmin-->Export-->sql
   If you only conduct a full backup, the sql can be found in "mysql->***.sql"
2, If you use aaPanel, then create a new blank site on aaPanel, create a blank Mysql
    If you use hosting, create a new wordpress site
3, copy the "homedir/public_html" to new server.
4, import the sql backup in phpMyAdmin
5, Edit the wp-config.php to update the new database name and account
6, If you changed the domain, go phpMyAdmin->wp-options, change the domain for "siteurl" and "home"

Now the mainpage can be accessed, however the subpages shows 404

1, If you use a hosting, login the wordpress control panel, go setting->permalink, change the permalink type and save. And then change it back and save.
2, If you use the aaPanel. Go to the config of this website (in aaPanel) and add the following code to the main braket
location / {

try_files $uri $uri/ /index.php?$args;

}

Back