Sunday, November 29, 2015

How To - Migrate Wordpress From Localhost to Production Server

1. Export local MYSQL database and import to MYSQL (production server).

2. Upload all localhost wordpress into you production server directory.

3. Change DB_NAME, DB_USER and DB_PASSWORD inside wp-config.php

4. Open wordpress database using MySQL tool (such PhpMyAdmin) and execute this SQL query:
UPDATE wp_options 
 SET option_value = replace(option_value, 'http://localhost/word_press', 'http://wordpress.site.my') 
WHERE option_name = 'home' OR option_name = 'siteurl';
 
UPDATE wp_posts 
 SET post_content = replace(post_content, 'http://localhost/word_press', 'http://wordpress.site.my');
 
UPDATE wp_postmeta 
 SET meta_value = replace(meta_value,'http://localhost/word_press','http://wordpress.site.my');
* Note : Please replace "http://wordpress.site.my" with you new wordpress URL location.

5.Login and go to the admin dashboard of your new website and browse to Settings > Permalinks. Select the structure you used for your local installation and save.

6. Done !

No comments:

Post a Comment