Forums

restoring wp db to local sql (6 posts)

  1. benkepes
    Member
    Posted 4 years ago #

    So I've backed up my live wp db and restored it to mysql on my local machine using phpmyadmin. I can see it in the mysql window but when i go localhose/wordpress the posts aren't there

    i'm assuming i need to reset some php files to "point" at the right db - any ideas????

  2. MichaelH
    Volunteer
    Posted 4 years ago #

    wp-config.php

    See Editing wp-config.php and Moving WordPress.

  3. benkepes
    Member
    Posted 4 years ago #

    so...

    wp-config.php reads as follows

    <?php
    // ** MySQL settings ** //
    // ** MySQL settings ** //
    define(’DB_NAME’, ‘wordpress’); // The name of the database
    define(’DB_USER’, ‘root’); // Your MySQL username
    define(’DB_PASSWORD’, ”); // …and password (needs to be empty, just for local install)
    define(’DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value
    define('WP_HOME', 'http://localhost/wordpress');

    define('ABSPATH', dirname(__FILE__).'/');
    require_once(ABSPATH.'wp-settings.php');
    ?>

    i have also changed "siteurl" and "home" in the database table "wp_options" to http://localhost/wordpress
    in phpmyadmin i can see the db and have done some queries and the db looks fine

    localhost/wordpress returns an "error establishing a db connection"

    any more ideas?

  4. benkepes
    Member
    Posted 4 years ago #

    so now I can login and see dashboard and posts etc - but when I click on "visit site" it takes me to localhost/wordpress and a blank page

    strange?

  5. MichaelH
    Volunteer
    Posted 4 years ago #

    And you followed all the instructions in Moving WordPress?

  6. benkepes
    Member
    Posted 4 years ago #

    sorted now - but I've seen somewhere a hack to allow both localhost and hosted db's from the same db (ie it'll default to local host when it sees it - otherwise hosted db)

    any idea where I can find that hack?

    cheers

Topic Closed

This topic has been closed to new replies.

About this Topic