giovedì 19 settembre 2013

How to upload WordPress Blog to New Domain or Location from localhost or Old Domain

For blogger who self-hosts the WordPress blog publishing system on a web hosting server with own registered domain name, sometimes, you may decide to reorganize the blog link URL to make it tidier or to reflect new focus or theme of the blog. If you decide to change the URL or link location of your WordPress blog due to changing of domain name (such as from http://www.old-domain.com/ to http://www.new-domain.com/) or the blog to another directory location (such as from http://www.domain.com/ to http://www.domain.com/blog/), there are some steps that should be done to ensure the proper migration and no breaking links.

The tricky part when moving WordPress blog to another location is that WordPress is using absolute path in URL link instead of relative path in URL link location when stores some parameters in database. Within blog posts’ contents itself, users may also use the old URLs when creating reference backlinks. All these values in the database will need to be changed when WordPress is moved. The following guide will show you which database fields that has references or values related to blog’s URLs that you want to modify. Note that this guide is not about how to move WordPress blog from one server or host to another new hosting service.

Once the blog has been moved (all files copy over in case of moving location or server or new domain name properly propagated across Internet for new domain name), the first thing to change is to tell WordPress the new blog location (wp-config.php should be no changes, and .htaccess file should be also no changes. If for some reason mod_rewrite rules for friendly URLs no longer works, you can always regenerate the .htaccess file via WP Administration’s Update Permalinks page).
This value can be changed via WordPress Options page, but if you no longer able to access to old blog URL, you have to modify the value via MySQL database.
Note: The guide uses SQL statements based on MySQL replace() function to modify the database. To run SQL queries, login to MySQL database that houses WordPress tables via phpMyAdmin or login to the DB server and run MySQL client as root.

To update WordPress options with the new blog location, use the following SQL command:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

Browse through WordPress blog to check if everything is okay. You also need to re-login to WP Administration as authentication cookie has now became invalid due to different domain.

46 commenti:

  1. Nice article...this post is outstanding in regards of both information as well as information.thanks for talking about you post with us.

    RispondiElimina
  2. I am very happy when read this blog post because blog post written in good manner and write on good topic. Thanks for sharing valuable information…....

    RispondiElimina
  3. I show up record it. I ache for to catch included this topic…i am respecting the time and fulfillment you put in your site,

    RispondiElimina
  4. Nice article...this column is outstanding in commendations of both advice as able-bodied as information.thanks for talking about you column with us.

    RispondiElimina
  5. Thanks for this admirable column ..lots of acknowledgment for you on this...by
    mgt 498 week 2 provider.

    RispondiElimina
  6. Thanks for this admirable column ..lots of acknowledgment for you on this...by
    mgt 498 week 2 provider.

    RispondiElimina
  7. Thanks for such innovative and astonishing information..Good here is really pleasant information.
    by HomeworkHelp provider

    RispondiElimina
  8. You are so cool! I do not think I have read something like this before. So wonderful to discover someone with some original thoughts on this subject matter. someone with a bit of originality!..... by
    mth221week5 provider.

    RispondiElimina
  9. Great column like this charge be awful recommended. It is so nice to apprehend such admirable blog. Thanks for sharing! Have a affable day ahead....by
    mth221week4 provider.

    RispondiElimina
  10. Great column like this charge be awful recommended. It is so nice to apprehend such admirable blog. Thanks for sharing! Have a affable day ahead....by
    mth221week4 provider.

    RispondiElimina
  11. This blog is actual arresting and you are accommodate best abstracts for users. I commonly travelled to your blog site.Thanks for your arresting administration .I accept abstraction your website and I got actual accessible and accomplished minutia from your website..by
    mth221week1 provider.

    RispondiElimina
  12. I am very happy when read this blog post because blog post written in good manner and write on good topic. Thanks for sharing valuable information…....
    mth221week1 provider.

    RispondiElimina
  13. Iam really glad that I have gone through a great post.keep posting these type of Articles which would be useful for everyone...please visit our website for more info:
    mth221week2 provider.

    RispondiElimina
  14. Hi,Having a beautiful website no one can find is like having a store and keeping the doors locked. I know it is there, you've done a great job decorating Web Design Cochin, the products are waiting for the customers, yet no one comes in.Thanks....
    mth221week3 provider.

    RispondiElimina
  15. Interesting blog and it contains very useful informations about blogs creations... thanks for posting....
    by ACC 205 provider

    RispondiElimina
  16. This is really wonderfull blog mail. I observed this blog farther more useful data. Thanks for sharing your useful outlooks.
    by MKT 421 Individual Assignment provider

    RispondiElimina
  17. thank god..this helps me a lot.m searching for thing like this website development company in coimbatore

    RispondiElimina
  18. this is the informative site..it is wonderful thank you for providing this information...

    RispondiElimina
  19. Great notion about world wide web conceive tips.Its helpful for all the beginners.Thanks for distributing this information..Keep up your work.
    by STR 581 Entire Course Provider

    RispondiElimina
  20. wow that must be greatest one ,because this as very informative site ,thank you so much for your wonderful jobsmosquito net in coimbatore

    RispondiElimina
  21. thank you for sharing how to use wordpress blog to change the domain as well outdoor advertising agencies in coimbatore

    RispondiElimina
  22. thank you for sharing such a very useful information..done a good job
    paneer manufacturers in coimbatore

    RispondiElimina
  23. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write
    Signature:
    i like play games friv 4 online and play games 2 girls 2 Download facebook movel

    RispondiElimina
  24. Innovative responsive website design and contemporary layouts are sure to excite your users, making them regular visitors of your site and a long term client of your company.
    happy wheels
    super mario bros
    pacman
    agario

    RispondiElimina
  25. Thanks for sharing the information. It is very useful for my future. keep sharing
    Kizi 123|
    Friv 234|
    Friv

    RispondiElimina
  26. I love all the posts, I really enjoyed, I would like more information about this, because it is very nice., Thanks for sharing.
    Friv 10

    RispondiElimina
  27. football heads Today, I search and read post when read this blog post because blog post written in good manner and write on good topic. free online mahjong Thanks for sharing with us... Thanks again!!!


    run 3 unblocked
    sports heads football
    head soccer 2

    RispondiElimina
  28. You need to kill time, you need entertainment. Refer to our website. hope you get the most comfort.
    Thanks you for sharing!
    Yepi
    Kizi
    Friv
    Friv Games

    RispondiElimina
  29. you'd have time to look these kids active. Please visit our website and let us play the game interesting.
    Thanks you for sharing !
    Friv 10 http://www.friv10-online.com
    Kizi 10 http://www.kizi10-online.com
    Yepi 2 http://www.yepi2-games.com

    RispondiElimina
  30. You are stressed and tired, you need entertainment. Refer to our website. hope you get the most comfortable.
    Kizi 4

    RispondiElimina
  31. you'd have time to look these kids active. Please visit our website and let us play the game interesting.
    Thanks for sharing !
    Friv 10
    Kizi 10
    Yepi 2

    RispondiElimina
  32. You need to kill time, you'd have time to look these kids active. Refer to our website. Hope you get the most comfort.
    Thanks for sharing !
    Friv 5
    Kizi 1
    Yepi 3

    RispondiElimina
  33. When you're tired, you want to relax after a stressful working hours, you need to have time to take care of the kids active.
    Please visit our website and play exciting flash games.
    Thanks you for sharing!
    Friv 4

    RispondiElimina
  34. Play the Best Free Games! We've picked out the racing games, cooking games, candy crush, games shooting, fashion games, ...
    Thanks for sharing !
    Kizi 200
    Friv 1
    Y88
    Y9

    RispondiElimina
  35. It’s really amazing that we can record what our visitors do on our site. Thanks for sharing this awesome guide. I’m happy that I came across with your site this article is on point,thanks again and have a great day. Keep update more information..

    Digital marketing company in Chennai

    RispondiElimina
  36. You want to relax after a stressful working hours. Refer to our website. hope you get the most comfort.
    Thanks for sharing !
    Friv 100
    Friv 8
    Friv 2

    RispondiElimina
  37. Thanks for the update and your great work. We're glad that you're reading the updates. SEO Company in Chennai

    RispondiElimina
  38. You want to relax after a stressful working hours. Refer to our website. Hope you get the most comfort.
    Thanks for sharing !
    GirlsGoGames
    Kizi 100
    Frvi

    RispondiElimina
  39. Thank for sharing!
    -----------------
    I'm working in the thay man hinh xiaomi. It's amazing

    RispondiElimina
  40. You need to have time to take care of the kids active. Please visit our website and play exciting flash games.
    Thanks you for sharing!
    Games2Girls
    Kizi 1000
    Frin
    Friv 3

    RispondiElimina