WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Issues moving live site to local MAMP install (8 posts)

  1. nachiketkumar
    Member
    Posted 1 year ago #

    Ok here goes:

    I'm having trouble getting a copy of a live site onto a local MAMP install-specifically I am not being able to connect to localhost. This is what I've done:

    1. MAMP installed (v2.1.2)
    2. Root folder of live site FTPd from server to desktop, in a folder called 'sites'. Call this site A. This site is currently running on WP 3.5.1, so it is the newest version.
    3. New DB created w/same name as live site DB through MAMP PHPMyAdmin
    4. Exported DB through live site PHPMyAdmin and imported into MAMP DB.
    5. Changed wp-config file to reflect correct DB name, host (localhost), user (root) and pswd (root).

    Settings in MAMP are defaults. doc root is set to /users/username/desktop/sites where username is my username for this machine. However, this problem I am describing is replicated exactly if I move the site to /MAMP/htdocs (which is the default option). Now the site is in htdocs and doc root in MAMP has been updated to reflect this.

    When I navigate to localhost:8888, I see a link to my site root folder. When I click it, I get an error message "Oops! Google Chrome could not connect to localhost". Same issue with Safari, it says it cannot connect to the server "localhost", nor can Firefox.

    Both servers are running in MAMP. So I created a new test site with a fresh WP install. Lets call this site B, created a new DB through PHPMyAdmin in MAMP, updated changes to a new wp-config file. Moved this site folder to htdocs as well.

    Now when I go to localhost:8888, I see both folders listed- Site A and Site B. Site A still does not load, but Site B prompts me to set up the Admin and then logs me in and takes me to the dashboard. So localhost is working and can be connected to.

    I've spent many hours trying to figure this out with no avail.

    I've tried creating a new user under Privileges in PHPMyAdmin to reflect the same username and pswd as the live site, so I would only change the DB host in wp-config. Didn't work.

    I completely deleted MAMP and reinstalled and repeated all these steps from scratch. Didn't work. Any help solving this will be appreciated.

  2. nachiketkumar
    Member
    Posted 1 year ago #

    Incidentally, and I'm not sure if this information is of any use, if I navigate to:

    localhost:8888/siteA/wp-admin,

    it takes me to the log-in page for the live site.

  3. CiderJack
    Member
    Posted 1 year ago #

    Regarding your second post - if you haven't already, make sure you've done a find/replace in your .sql file and replaced the old domain url with localhost. This should make all links stay local. (not sure you need the port number - this may or may not make a difference. I use XAMPP on Windows and I'm not familiar with the specifics of MAMP)

  4. nachiketkumar
    Member
    Posted 1 year ago #

    CiderJack- that helped more than anything else I'd tried. I had tried the find/replace before but I think I was putting in the wrong path for localhost.

    I replaced http://siteA.com with http://localhost:8888/siteA and now some pages are working but others don't load. Homepage and wp-admin work, blog page works but other main pages dont load.

    I can provide more information about this- what would someone need to know in order to suggest a fix?

    Thanks again.

  5. CiderJack
    Member
    Posted 1 year ago #

    Feels like I'm running around recommending this fix to everyone - not quite sure it will work for you, but it sounds similar to what I just went through with xampp. When you say the pages don't load do you mean they're blank, or is there some sort of error?

    You could try changing your permalinks via wp-admin and see if that forces WP to rewrite your .htaccess file, which is what my (similar) problem had been. If the pages load now, you can set the permalinks back to your custom setting and should be all set. (or delete the content of the .htaccess file, save it, and change permalinks.)

    Other than that, I'm out of ideas. Good luck!

  6. stoatoffear
    Member
    Posted 1 year ago #

    If you visit the permalinks page it should reset the permalinks for you.
    Usually though when migrating a WordPress sql file, if you're changing any URL strings to http://localhost:8888/siteA, then you need to change the string length as well.
    Before each string you will see something like s:105
    That's the length of the string that follows it - change all those to the whatever length each string is now.
    Works for me.

  7. nachiketkumar
    Member
    Posted 1 year ago #

    Gentlemen,

    Thank you for your suggestions- it fixed my problem.

    For future reference and to help others, what I meant when I said some pages don't load was this: an error message that said something like 'the URL siteA/page1 could not be found. No error number as far I remember- I fixed the issue before noting down the exact wording!

    I went into wp-admin as suggested and changed the permalink structure from post-name to default. This seemed to fix one of the problematic pages but not the other two. I then changed it back to post name and that fixed all the pages.

    stoatoffear, I'm not savvy enough to follow your suggestion of changing string length, although I didn't need to do it to fix my issue. Someone else might find it helpful.

    Thanks for the help again.

  8. russellwmoore
    Member
    Posted 11 months ago #

    I know this is a resolved issue, but I thought I could add the following which has saved me loads of time and headache.

    One tool that is not mentioned in this thread is Interconnectit.com's Search and Replace Tool.

    This tool takes care of url renaming and the serial string business. I put the php script in my root folder of MAMP (NOT my wordpress intstallation, due to the localhost connectivity issue mentioned by nachiketkumar) and entered in the appropriate database information and ran the script to replace my live site url with localhost:8888/'wordpress folder'

Topic Closed

This topic has been closed to new replies.

About this Topic