Here is how you can migrate your WordPress website from one hosting server to another:
Step I: Back your website files – There are plugins available that will completely backup your website. You can also use FTP programs such as WinSCP or FileZilla, connect to your web host and copy all files within your website’s directory to a folder on your local computer. (Remember to display hidden files while copying)
Step II: Export the WP database – Login to your cPanel > open phpMyAdmin application > Select the database having WordPress installation > Click on Export > Use by default settings (Quick export method and SQL format) > Click on Go (download it on your local computer)
Step III: Create a WP database on your new hosting server – Login to cPanel > Open MySQL Database > Create a new database > Create a new MySQL user > Add this user account to new database and grant it All privileges (keep a note of DB name, username, and password)
Step IV: Edit the wp-config.php file – Browse through the downloaded website files. Locate the wp-config.php file. Open this file in text editor and make a few changes. Replace the DB name, username, and password with the newly created database credentials noted in Step III. Save the wp-config.php file and close.
Step V: Import the new database – Launch phpMyAdmin from the cPanel > Select your new database > Select the import tab from the navigation menu > Choose the SQL file you exported previously > Untick the partial check box (check the format is set to SQL) > Click on Go > Message box will appear confirming the success of the import.
Step VI: Upload the WordPress files to your new host – Open file editor > Open the public_html folder in the common directory > Click on upload and select your website files from your desktop containing updated version of the wp-config.php file.
Step VII: Install WordPress: On your browser type www.domain-name/wp-admin/install.php. Complete installation and done.