if you are going to read this blog that mean you have  this problem :

you need to configure your database after you upload to your domain ,

-you might find some broken links.

-your css doesn’t exists .

-your posts disappeared .

-your navigation system simply destroyed .

So , Go on , it would be only view lines to your database .

 


update wp_options set option_value = replace(option_value,'localhost/yourfolder','yourdomain.com');
update wp_posts set post_content = replace(post_content,'localhost/yourfolder','yourdomain.com');
update wp_posts set guid = replace(guid,'localhost/yourfolder','yourdomain.com');
update wp_postmeta set meta_value = replace(meta_value,'localhost/yourfolder','yourdomain.com');

lets put some assumptions :


/*B+*/
define('WP_HOME','http://localhost/foldername');
define('WP_SITEURL','http://localhost/foldername');

————————————————————————————————

/*Appply to */


MylocalHost : http://localhost/wp_idev.com
My Domian   : http://idev-inc.com/projects/idev.com

————————————-From local Host to Domain  ———————————————————–


update wp_options set option_value = replace(option_value,'http://localhost/wp_idev.com','http://idev-inc.com/projects/idev.com');
update wp_posts set post_content = replace(post_content,'http://localhost/wp_idev.com','http://idev-inc.com/projects/idev.com');
update wp_posts set guid = replace(guid,'http://localhost/wp_idev.com','http://idev-inc.com/projects/idev.com');
update wp_postmeta set meta_value = replace(meta_value,'http://localhost/wp_idev.com','http://idev-inc.com/projects/idev.com'); 

and a bit sophisticated one that you want to move your site from Domain to local host , you will need to reverse it

————————————-From Domain to local Host ———————————————————–


update wp_options set option_value = replace(option_value,'http://idev-inc.com/projects/idev.com','http://localhost/wp_idev.com');
update wp_posts set post_content = replace(post_content,'http://idev-inc.com/projects/idev.com','http://localhost/wp_idev.com');
update wp_posts set guid = replace(guid,'http://idev-inc.com/projects/idev.com','http://localhost/wp_idev.com');
update wp_postmeta set meta_value = replace(meta_value,'http://idev-inc.com/projects/idev.com','http://localhost/wp_idev.com');

define('WP_HOME','http://localhost/wp_idev.com');
define('WP_SITEURL','http://localhost/wp_idev.com');

Hope it will solve some issues there , 🙂
you will found more details here : http://codex.wordpress.org/Changing_The_Site_URL ,

Regards

Author

Write A Comment