WordPress.org

Ready to get started?Download WordPress

Forums

Duplicate MySQL on local testing server (5 posts)

  1. Storyman
    Member
    Posted 5 years ago #

    The WordPress site is up and running on the web and just installed a local testing server (Apache/php/mysql) on my home computer. I'd like to suplicate the articles, categories, and pages from the web site database to the local testing server database.

    When the site's (on the web) MySQL is exported, then imported into the MySQL on the testing server access to WP-ADMIN gets fouled up. When WP-ADMIN is accessed on the testing server it jumps to the web site's administrative area.

    I've tried exporting/importing all of the tables except for the options table, but MySQL errors occur.

    What is the trick to importing the articles posted on the web to the local testing server without fouling up access to the administrative area?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    SITEURL and HOME. Define those two in the wp-config.php file for your local site to override the database settings.

    define('SITEURL','http://localhost');
    define('HOME','http://localhost');
  3. Storyman
    Member
    Posted 5 years ago #

    Hi Otto42,

    Thank you for the incredibly fast response.

  4. Storyman
    Member
    Posted 5 years ago #

    Hi again,

    Added to the config file:

    define('SITEURL','http://localhost');
    define('HOME','http://localhost');

    Exported the web site's database and imported to the local testing server's database.

    When accessing the local testing server the browser is redirected to the site hosted on the web. Same when accessing WP-Admin.

    The approach to define the SITEURL and HOME in the config file makes sense.

    What can be done to override the redirect to the website?

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Whoops, wrong defines. That should be WP_SITEURL and WP_HOME. My bad.

    And that will stop the redirect for you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.