• I’ve just tried to make a local copy of WordPress site, and after doing everything according to the knowledgebase instructions, from Google Chrome it keeps redirecting me to the live site when I enter https://localhost/sitefolder, Firefox returns the message “The page isn’t redirecting properly” and IE gives me HTTP 500 internal server error. Now here is what exactly I have done.

    1) Made an SQL backup of my database from phpMyAdmin.
    2) Copied the entire content (files and folders) of my site locally.
    3) Installed XAMPP.
    4) Run the Apache and SQL services from XAMPP.
    5) From a text editor, in the database SQL backup file replaced all the instances of https://www.domain.com with localhost/sitefolder (the one within the htdocs of xampp).
    6) Created a local database in phpMyAdmin from XAMPP, and then imported the modified SQL backup into that database.
    7) Modified the local copy of wp-config file to reflect the database, user and pasword changes (including changing the DB host to ‘localhost’).

    Did I miss any steps? I can’t figure out what is causing the skip to https://www.domain.com, when there are no remaining references to it in the database.

    Any hints?

Viewing 4 replies - 1 through 4 (of 4 total)
  • and then imported the modified SQL backup into that database.

    Review Moving_WordPress.

    Thread Starter Bluealek

    (@bluealek)

    Looks like I’m getting somewhere. Restarted the Apache and mySQL a few times, and now I’m getting Error establishing database connection in all three browsers. So I guess now it’s a problem with the wp-config settings. What exactly should I put there for a local installation?

    Thread Starter Bluealek

    (@bluealek)

    Ok, got the wp-config parameters correctly. However, the site is far from working – the theme and many plugins need to be reconfigured manually. I think I’ll drop the idea of getting the local copy, there’s simply too much work to do, especially when it’s a complex site with tons of plugins.

    Esmi, that is the article I started from.

    Before you give up, let me give you a tip (it may help). Don’t change everything! If you want to develop locally, your method is one way to skin the cat. Another is to create a virtual host in your apache for the actual domain name, and then edit your computer’s hosts file to point requests to the domain to your local folder. Here’s how it works (believe me — do it a few times and it really is easier!):

    1) Download the MySQL database and site files, put the files into a folder, and load the MySQL database into your local MySQL.
    2) In your local MySQL for that database, add a user with the same credentials in your wp-config.php.
    3) Add a virtual host in your apache config file to point to the folder with your website files as the document root.
    4) Add an entry in your hosts file for the domain.

    Now, when you go to the domain name, it looks on your local box and pulls up the site. Develop as you normally do, and when ready, FTP your changes to the live site. Comment out the hosts file entry and refresh your browser, and you’ll then be looking at the live site.

    No changing code, no replace functions in MySQL, and any hard-coded urls in your theme will work perfectly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Local copy of site not working properly’ is closed to new replies.