Forums

[resolved] WordPress Migration And Localhost (7 posts)

  1. BUxykay
    Member
    Posted 7 months ago #

    Hi, I need help fast if possible. I had this bad luck to be hacked and the hosting service had to delete my database. Fortunately(or unfortunately), I have a mysql database backup since my last post.

    Now since the database and my site are no longer on the hosting, I installed wordpress on my localhost on my computer with the intention to export the posts in xml format and then import it on another wordpress installation on another host. I want to use the same domain name.

    After importing the database into phpmyadmin on my computer, I wanted to see what I have done and this is where problems started. The front page(home page) showed a list of recent posts as well as the widgets on the side bar although the theme is different. As I clicked the links to the posts, they returned error. I wanted to go to the admin panel but I was redirected to the url with "Error establishing a database connection".

    Please I need help how I can use the database backup to retrieve my posts which are well over 300.

    PLEASE HELP ME SOMEBODY!

  2. Samuel B
    moderator
    Posted 7 months ago #

    are you sure the local wp-config.php has the correct database details?

  3. BUxykay
    Member
    Posted 7 months ago #

    Thanks Samuel for your reply. I configured the localhost wp-config.php exactly as the one on the hosting. The same Database name, the same user and password.

  4. Samuel B
    moderator
    Posted 7 months ago #

    that may be the problem
    on my xampp installs (and I understand wamp is the same) the databse user is root and there is no password

    use the db creation part of this guide to create another database and test
    http://tamba2.org.uk/wordpress/xampp/

  5. BUxykay
    Member
    Posted 7 months ago #

    Yes I first created a database on my xampp and then imported the database back up. When I installed the new wordpress the posts urls were displayed but on clicking them they directed me to the former url and displayed the error message.

  6. kionae
    Member
    Posted 7 months ago #

    If you don't change the values of siteurl and home in the wp_options table, WordPress will redirect you to whatever domain was originally specified.

    Set those two records in the database to http://localhost/whatever-the-path-is

  7. BUxykay
    Member
    Posted 7 months ago #

    Thanks Kionae and Samuel B. I finally succeeded to retrieve my posts. Thanks for your support.

    This is what I did:
    1. Opened up the sql file in wordpad

    2. I then used the Edit --> Replace function which replaced the new url with the old one

    3. Imported the sql file into pühpmyadmin. This created a database on my localhost with the same name and data.

    4. Launched wordpress from my localhost and then

    5. In the admin panel Tools --> Export --> All contents in xml format.
    Now this is where I met with problem again. As I wanted to import the generated xml file into my new server, I got error that the limit is 2M and the xml is 2.1M. Is there a way round this?

    I decided to export and import by categories which was time consuming but I made a few then I got tired doing this and wanted to know if there is an easier method.

Reply

You must log in to post.

About this Topic