Ready to get started?Download WordPress


Moving WordPress between different hosts and domains (9 posts)

  1. bksub84
    Posted 2 years ago #

    I currently have a wordpress blog on http://domain1.com/blog

    I want to move this to http://domain2.com

    http://domain1.com/blog and http://domain2.com are hosted on two different hosts.

    This is what I did so far:

    Installed WordPress (using fantastico) on http://domain2.com
    Downloaded wp-content folder of http://domain1.com/blog using FTP and uploaded it to http://domain2.com
    Exported sql database of http://domain1.com/blog (from phpmyadmin)
    Replaced all occurrences of http://domain1.com/blog to http://domain2.com (using notepad++)
    Imported this sql file to http://domain2.com (using phpmyadmin)
    The problem now is...

    I am unable to login to http://domain2.com/wp-admin/ using the username and password which was working fine when I installed.

    Another problem is when I point my browser to http://domain2.com it displays the home page fine BUT when click on the pages, it throws a 404.

    One more weird thing I noted it, after importing the edited sql my new domain's admin user name has got changed back to the username which was referred by my old domain. How could this be possible? I had to login to my new domain's phpmyadmin and reset the password to be able to login.

    When I logged in... another surprise. I was able to see only 'Dashboard' and 'Profile' tabs. No other tabs (like Pages, Posts, Appearance, etc) were visible.

    Can someone come forward to help me out with this issue please? It is a client's site so can not give out the original data. But if you can be kind enough to help me fix this, I can mail you the details.


  2. vtxyzzy
    Posted 2 years ago #

    Try to follow the steps in the Codex:


  3. bksub84
    Posted 2 years ago #


    I did follow that. I will tell you in short what I did again:

    Assume the URL where I developed the site is http://old-domain.net/blog and I want to move this to http://new-domain.com

    These are steps I carried out:

    1. Install a fresh wordpress (using Fantastico) in http://new-domain.com

    2. Downloaded the wp-contents folder from old-domain.net/blog/wp-contents folder and uploaded it tonew-domain.com/wp-contents folder

    3. Exported the sql file from http://old-domain.net/blog. Used notepad++ to manually replace all occurrences of http://old-domain.net/blog to http://new-domain.com

    NOTE: I know the documentation says "Use Search and Replace for WordPress Databases Script". But at this point of time, I do not even have a DB yet on my http://new-domain.com. So, when the script searches for "http://old-domain.net/blog" in my new domain's DB it will not find even a single occurance. That is why I had to replace it all manually using Notepad++

    TILL THIS POINT, everything is fine.

    4. I import the SQL to my new domain's DB then

    -> the admin login username changes back to the admin name of my old domain's blog
    -> The Admin email ID changes back to the admin name of my old domain's blog
    *** This prevents me from logging onto the Dashboard

    -> The homepage works fine but the pages all give me 404

    -> I tried to manually change the admin username from phpmyadmin of my new domain. But the when I login, I only see the Dashboard and Profile tabs.

    I know the problem happens only after importing the sql but what do I do to fix it?


  4. vtxyzzy
    Posted 2 years ago #

    3. Exported the sql file from http://old-domain.net/blog. Used notepad++ to manually replace all occurrences of http://old-domain.net/blog to http://new-domain.com

    There is probably where the problem occurred. In the database, many of the values are stored in 'serialized' strings. The length of the string is stored along with the string. Unless the old and new strings are exactly the same length, the serialized string is broken and will not load properly.

    I have had good luck using the WP Migrate DB plugin to migrate a DB from one site to another. It processes serialized strings correctly.

    The only tricky part is that you must know the absolute file load paths of both sites as well as both URLs.

    The URLs are easy and here is an article that tells how to get the paths:


  5. blogvkp
    Posted 2 years ago #

    I don't think you will need to do all these things.

    If you have your posts and files in your old blog, then just go wp dashboard and click tools and select export. and click All content "This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts."

    Then move to your new wordpress dashboard ( just install new fresh copy of wordpress ), then again go to dashboard, click tools and select import. You will need to install new plugin when you will click on wordpress " Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file. ".

    Now browse your xml file which you downloaded from previous domain. And upload it.. it will sak for download all attachments and allow this process. Your all files and posts are now present in new wordpress blog..

    [link moderated]

  6. bksub84
    Posted 2 years ago #


    Thanks for your reply. I am now going to start it over and try WP Migrate DB this time. It may take me another 4-5 hours.

    I will see if I managed to make it work this time and report back as well.

    Thank you!

  7. bksub84
    Posted 2 years ago #


    I tried it and guess what? That WP Migrate Plugin actually helped me solve half the problem.

    But then, now I can see the homepage fine. BUT, the pages are not loading. They give me a 404. Even if I try to view them from click on the "View" from Pages tab on the Dashboard, it still gives me a 404.

    Any idea how can I get over this?

  8. bksub84
    Posted 2 years ago #

    WooHoo!! this thread saved me - http://wordpress.org/support/topic/home-pages-are-fine-but-inner-pages-show-404-error?replies=3

    The trick is

    Set your Permalinks back to default and then try re-setting Permalinks back to what you want.

    All works fine now. Thanks so much!

  9. vtxyzzy
    Posted 2 years ago #

    If your problem has been solved, please use the dropdown on the right to mark this topic 'Resolved' so that anyone else with this question can see that there is a solution.

Topic Closed

This topic has been closed to new replies.

About this Topic