1

I'm doing some work on a client's wordpress so to not touch the live I imported what I thought I needed from their FTP into my xampp to reproduce their environment. Their website is hosted on bluehost, for reference.

I Exported/imported their phpmyadmin database, as well as copying over the parent theme and the child theme from FTP. I copied over the wp-config.php for database credentials. It seems like i'd have covered all the bases but it's giving me that error still. What else could I be missing to get this working?

DB_HOST is also already set to localhost

Googling this error didn't yield much for my scenario

Are there more things I should import over from their FTP to emulate 1:1 their environment?

Thanks

2 Answers 2

1

The database password is not stored in the database itself, so importing the database via phpmyadmin will not also import the password. You need to manually edit your local copy of wp-config.php, and enter your local username and password for MySQL ( or any other database you are using ).

Usually the default username for local development installations is root, and the password is blank, so you can try these. Otherwise, you can check xampp's website to see what the default password, or if you have already set your own password during installation, you can use that.

5
  • Wow what an oversight on my part. Good to know. Thanks! As far as importing all the other configurations the client might have done, am I missing any files? Or is the theme/theme-child and index.php/wp-config.php enough?
    – Dennisio
    Commented Apr 23, 2019 at 2:38
  • You're welcome. You should consider downloading the entire wp-content folder. There might be active plugins, uploaded medias, custom .htaccess files, and so on.
    – Johansson
    Commented Apr 23, 2019 at 2:46
  • Understood, i'll download those for good measure. One final question as I finally managed to get into the wordpress console...I didn't think about this one but how do I redirect this to loading from my localhost? After logging in from "localhost/wordpress/wp-admin" it has redirected me to the online wordpress console so it's basically routing me outside of localhost and i'm back on the clients console/website. I'm guessing it has to do with some kind of other wordpress configuration?
    – Dennisio
    Commented Apr 23, 2019 at 2:54
  • You also need to change 2 values in your local database. Check the wp_options table ( assuming that the database prefix is wp_ ). You will find 2 options, named home and siteurl. You need to change these values to match your local. In your case, I think the value will be http://localhost/wordpress. Also, the browser cache needs to be cleared to prevent any cached redirection.
    – Johansson
    Commented Apr 23, 2019 at 3:26
  • That did the trick. Thanks again for everything!
    – Dennisio
    Commented Apr 23, 2019 at 3:42
0

If you need to move more sites in the future, Duplicator plugin is nice and easy.

It will create two files, an archive and a install file. Upload the files to your server, create the database and user, run the installer file and it will guide you through the process. Everything will be copied over and it will allow you to update the site links and all the database connections.

The only catch is that it can timeout on very large sites.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.