• Hi,

    I’m trying to create a local version of a live site (www.thejournalmag.org) using MAMP. I’ve followed all the directions here (https://managewp.com/how-to-create-a-local-copy-of-a-live-wordpress-site), but whenever I go to load the site I get the “error establishing a database connection” message.

    I’ve gone back and checked my user name and password, and re-entered them, and I still get the same thing. Anyone have any ideas what might be wrong? I am using ports 81 and 3307 because I couldn’t get Apache and Mysql to run using 80 and 3306.

    I’m trying to create a local version to see what an upgrade to the latest version of WordPress will do to our site.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter lcbarret82

    (@lcbarret82)

    Also, when I attempt to go to https://localhost:81/mysitefolder/wp-admin, it says that either my user name and password is wrong, or that they are having trouble connecting to ‘db368977500.db.1and1.com’ Should the .db.1and1.com still be there, since I’m installing it on a local server? Where can I change that?

    May I suggest using the default settings for MAMP, that is, port 8888 for Apache, port 8889 for MySQL and the default values for the database server, which are root (user) and root (pwd). Then:

    – create a new, empty db and import into it the exported live site db
    – edit the siteurl and home fields in the wp_options table with the local URL, i.e. https://localhost:8888/mysitefolder
    – edit the wp-config.php file in the local site with the updated db info:

    Database Name: whatever you named it (no spaces)
    User Name: root (this is the default MAMP database user name)
    Password: root (this is the default MAMP database password)
    Database Host: localhost
    Table Prefix: wp_ (leave as-is or whatever it is on the live site)

    Log in to the WP Dashboard https://localhost:8888/mysitefolder/wp-admin and install and run this plugin to update your site’s links (menus, images, etc.)

    https://www.ads-software.com/plugins/velvet-blues-update-urls/
    – select all options EXCEPT the last one (GUID)

    If your site had links that are stored in the DB as serialized strings then place this script in the site’s folder and run it:

    https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
    – this is a standalone script that updates any serialized strings in the DB; the above plugin does not handle this

    You should be good to go ?? I use these two all the time when moving to or from live / local or when the URL changes.

    Thread Starter lcbarret82

    (@lcbarret82)

    Thank you!

    I’ve got the site up and running but even after running the plugin most of my links are broken, so I take it I need to run that script. I’m a relative newbie to all this, so forgive the dumb question, but how do I “run” the script? It’s in my site folder right now.

    Thread Starter lcbarret82

    (@lcbarret82)

    Okay, so I figured out how to run it, but now I don’t know which databases to have the script run on. If I pick all of them, would that be terrible? (I inherited this site, so I am not completely familiar with its inner workings.) But I know it uses categories to allocate posts to certain pages, and I think that’s what’s broken right now. The main page of the local site looks great; everything else returns a 404.

    Thread Starter lcbarret82

    (@lcbarret82)

    Never mind, just had to change/save my permalinks! Thanks again!

    Never mind, just had to change/save my permalinks!

    Sorry about forgetting to add that at the end of the steps ??
    Glad to hear you got it working.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can't get local copy of live install to work on MAMP’ is closed to new replies.