• colsut

    (@colsut)


    I downloaded a backup from my live website and restored it to my local host via phpMyAdmin because I wanted to have an exact copy of the real site on my local machine.
    But now when I click on to localhost it doesn’t point to my local machine but to the live website – would appreciate help to get out of this one!
    thanks

Viewing 14 replies - 1 through 14 (of 14 total)
  • Doodlebee

    (@doodlebee)

    When you imported the backup to your localhost, did you remember to change the stuff in the SQL file to reflect your localhost settings? Or did you just backup the live site and the import to your localhost machine?

    Most likely, your database settings (and perhaps even your table prefix) on your localhost isn’t he same as your live host. When you do this kind of thing, you have to open up the SQL file in a text editor, and change the database settings to reflect the proper database. If you don’t do that, then what you’re seeing will generally happen.

    At this point, what I would do is drop the database from your localhost (and get that back) and then open up our SQL file and make the necessary changes (usually, it’s just a matter of changing a couple of lines at the top of the file, so it points to the right database, as well as changing the wp_options area to reflect the correct home URL and site URL). Also make sure your wp_config.php file has the connection settings to your localhost machine, and not your live site. Save (and “Save As” – don’t overwrite your backup) and import *that*.

    moshu

    (@moshu)

    At this point, what I would do is drop the database from your localhost (and get that back) and then open up our SQL file and make the necessary changes (usually, it’s just a matter of changing a couple of lines at the top of the file, so it points to the right database, as well as changing the wp_options area to reflect the correct home URL and site URL).

    Aren’t we over-complicating it?
    If you have a local install, probably, you have phpmyadmin, too. Edit the “home” and “site_url” values in wp_option table. Done.

    Thread Starter colsut

    (@colsut)

    moshu, I’ve tried you’re solution before attempting doodlebees but can only see “site_url” in the wp_option table.
    I changed that to https://localhost/ and pressed go in phpMyAdmin but it hasn’t solved the problem.
    Where is the “home” value in phpMyAdmin?

    moshu

    (@moshu)

    When showing those options the table rows are “paged” – click on those > signs to go further ??

    Thread Starter colsut

    (@colsut)

    Moshu

    thanks for that
    I am now back on my localhost environment which is brilliant
    unfortunately, even though I can see the home page of my website, clicking on other pages just gets me:
    The requested URL /contact was not found on this server.
    I guess that might have something to do with the backup I tried to restore using plugin WordPress Database Backup 2.2.1
    It looks like I might have to start again (but more carefully next time)
    all I wanted to do was set up a local copy of the website so that I could experiment/make changes safely!
    Anyway, thanks very much for your help

    moshu

    (@moshu)

    Set your permalinks to default (on the local install)!

    Sidenote. Now, I do have many local installations to experiment with themes and other solutions. However, I find it insane to import the database of whole my online blog just for the sake of design experiments…
    Just my $0.02

    Thread Starter colsut

    (@colsut)

    i’m very new to all this and the website really is very small at the moment. Even the word permalinks is new to me!

    Thread Starter colsut

    (@colsut)

    but “a bit insane” is a bit more familiar somehow?

    moshu

    (@moshu)

    Well, when you are so new… maybe you should start getting familiar with your own WP admin panel (all the subpanels and their features) before attempting something like this local install.

    admin > Settings > Permalinks

    Thread Starter colsut

    (@colsut)

    sorry – didn’t realise I needed to be an expert before I asked for help

    moshu

    (@moshu)

    Don’t need to be an expert… but it is a reasonable expectation that you take a look at the tool you are using.

    Thread Starter colsut

    (@colsut)


    but I’ve got to say thanks again
    your advice has been much appreciated and has been spot-on
    my local site is up and running again
    I will find my way around eventually, just a lot to learn in a short space of time just now. It’s a church website and nobody else knows how to do it either.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    For testing with live data on my own machine, I add extra defines to my own machines wp-config.php file:

    define('WP_HOME','https://localhost');
    define('WP_SITEURL','https://localhost');

    This overrides the database settings and lets me not have to screw with it every time I update the local database.

    Thread Starter colsut

    (@colsut)

    thanks for that Otto42
    I’ve just amended my wp-config.php to include those defines – just in case I manage to mess things up again

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘backup resulted in localhost showing Live site!’ is closed to new replies.