[WordPress] How to change your webhost or domain and still retain all the settings
Sometimes, we can be mad about our webhost (due to shitty downtimes etc) and would want to move on to a better host. You would even want to change your domain name.
Here’s a complete tutorial on how to make the move and still retain ALL your blog posts, comments and settings. I have made this tutorial, as noob friendly as possible.
PS: You can skip some the third part if you just want to move to another webhost (not the domain).
Exporting MySQL Database from Server 1
1) Open PHPMyAdmin, select the database where you have wordpress installed. Click on Export.
2) Most probably you won’t have to care about the configuration. Just press “Go”
3) You’ll have a database. Select All (Ctrl + A) the text, Copy (Ctrl + C) and Paste (Ctrl + V) it on a Notepad (Run –> Notepad).
Creating MySQL Database on server 2
1) Goto your Control Panel. Click on MySQL Databases.
2) Create a new database (say yournewwordpress)
Preparing MySQL Database from server 1
1) Click on Edit –> Replace.
Find : youroldwebsite.com
Replace : yournewwebsite.com
Press Replace All
2) Change this to your MySQL Database name
Database”: ‘yournewwordpress’
3) Very rarely there can be problems with the upload path.
Search for “upload_path”. Make sure its like this:
‘upload_path’, ”, ‘yes’);
4) Save file as UTF-8
Uploading / Importing Modified MySQL Database to server 2
1) Open PHPMyAdmin and then choose “yournewwordpress” database on the sidebar. Now, click on the import tab.
2) Just upload your SQL Database and press go.
Taking care of wordpress files
1) Open File manager and goto “public_html” Select All and Compress. Download this file.
2) Upload this file to server 2 and extract.
3) selec wp-config.php and press edit.
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘putyourdbnamehere’);/** MySQL database username */
define(‘DB_USER’, ‘usernamehere’);/** MySQL database password */
define(‘DB_PASSWORD’, ‘yourpasswordhere’);/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);
Now goto yourwebsite.com/wp-admin check if it worked, else submit a comment below.
Summary:
1) Obtain your MySQL Database from your first webhost.
2) Prepare it for the upload.
3) Upload it to the second webhost.
4) Enjoy!
PS: This tutorial can be a little tricky for some people. If you need any help, you can contact me or comment.