Forums

Moving from server to personal pc (5 posts)

  1. mikecroteau
    Member
    Posted 2 years ago #

    Hi, I am very new to wordpress so please excuse my newbness....

    I am trying to duplicate an instance of wordpress that is live on my local personal machine.

    I restored the database locally
    I downloaded all wordpress files into my new directory.
    I changed the wp_config.php db settings

    but found that my pathing is off. So I tried numerous things:

    Tried setting

    define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress-instance');
    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/wordpress-instance');

    I tried changing the wp_options 'site_url', 'home' to from http://siteurl.com to http://localhost/wordpress-instance

    I queried the wp_options table and replaced all http://siteurl.com to http://localhost/wordpress-instance

    Still... when I browse to home or any page all images that have relative pathing are broken/not showing up. (example: <img src="/website-images/image.png">).

    Im out of answers. Any help on this would be most appreciated. Im sure its something small that I missed...

    Thanks in advance!

    ps. I read the "Moving WordPress" article, still no go.

    Mike

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    See if using this plugin and replacing OLD url with NEW url helps:
    http://wordpress.org/extend/plugins/search-and-replace/

  3. theBlackSheep
    Member
    Posted 2 years ago #

    depending on what local server you're using, eg, wamp, xamp, mamp, as it might differ in places...

    from scratch,

    download a copy of your database,

    download your wordpress directory,

    run your local server.

    in your local phpmyadmin or equivalent, create a new database with the same name as the live one.

    import your downloaded database to the local one, it'll update the tables.

    check your username and password to see if they match the live database and ensure your priveleges are ALL.

    put your downloaded wp directory into wherever you're supposed to according to your local server instructions, eg 'htdocs'

    in phpmyadmin, in your wp database change both 'site_url' and 'home' entries in 'wp_options' to http://localhost

    in your browser, go to http://localhost

    see if that works.

    s..

  4. mikecroteau
    Member
    Posted 2 years ago #

    Wow, you guys are fast... I tried the search and replace tool.. still no luck. theBlackSheep: I basically did all that you mentioned which led me to here.

    I will go back through and see if I missed something....

    Any additional ideas would be most appreciated.

    Thanks again.

    Mike

  5. theBlackSheep
    Member
    Posted 2 years ago #

    do exactly as i said, clear your cache, don't change your wp-config, make sure your local server is set up right, make sure it points to the root of your wp install, don't add anything to http://localhost in your address bar when viewing your home page locally, don't change any other entries in your database; the live and local settings should be the same apart from the site_url and home entries.

    unless someone else can jump in and suggest something different.

    s..

Topic Closed

This topic has been closed to new replies.

About this Topic