• Resolved 80grit

    (@80grit)


    Fellow citizens. I’m about to yank out the solitary hair remaining on my noggin’.

    What once seemed so simple has now been burried beneath an avalanche of confusion and excess information. I think….I’ve mixed up the last step or two in backing up an existing www.ads-software.com site on to my localhost. But here’s a summary of my situation:

    Want to back-up an existing www.ads-software.com (v.3.5) site to my computer and update it to a more recent version of WordPress(v.3.6), then make changes to the content.

    a.) Successfully downloaded WordPress 3.6 on my computer. It functioned fine until I began implementing the following steps.
    b.) The existing WP site (v.3.5), which I need to back-up and make changes to, was designed by someone else about a year ago by someone who isn’t around now.
    c.) Have backed-up the existing WP site to my computer.
    d.) I recently got admin privileges from our webhost for the existing WP site.
    e.) Successfully downloaded MAMP on my Mac computer. It functions fine.
    f.) Have set Document root, as instructed, in MAMP Preferences. I placed the WP files in Applications/MAMP/htdocs
    g.) Have backed-up WP mySQL database. Potential issue: Once renamed, should the mySQL database be placed within the htdocs folder? Secondly, can I rename the database anything I want, or must it be named something specific?
    h.) Have created a wordpress database in MAMP phpMYadmin. Should the naming of this database be different than the mySQL database. And, yes, I have gone into the ‘wp database options’ to change ‘siteurl’ and ‘home’ to the localhost document root.

    Whenever I do attempt the following:
    ‘localhost:8888/MAMP/htdocs/site_all_files’
    I get a ‘404 Not Found’ error message.

    Miscellaneous
    Have consulted numerous YouTube videos on this process. The useful videos seemed clear and straightforward. Yet when I follow the steps – no dice.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hey there! Let’s see if I can help walk you through the process.

    1) Download a fresh WordPress installation – the current version is 3.7.1. If you need to use an earlier version, visit: https://www.ads-software.com/download/release-archive/ although for best security practice, try and stay up to date!

    2) Launch MAMP

    3) Using MAMP’s phpMyAdmin create a new database – for your purpose, name it the exact same as your live server’s database.

    4) Unzip the WordPress folder and place it in your MAMP application folder’s htdocs folder. That is, go to where MAMP is located on your machine, typically in your Applications folder, and locate the htdocs folder. This is where you’ll place the WordPress folder and it’s contents. The htdocs folder is the typical “root” folder of an Apache webserver for future knowledge – all webpages and directories located in this directory can be served to the web.

    5) Open up the wp-config-sample.php file and fill in the required information – your database name, the database user name (for MAMP this will be root), the database password, etc. You may find https://generatewp.com/wp-config/ a useful online tool for generating your WordPress configuration file, including whether to allow automatic updates if you’re using WordPress 3.7.

    6) Save your edited file as wp-config.php.

    7) Make sure MAMP is running and open up your browser and point it to: localhost:8888/name_of_wordpress_folder – where name_of_wordpress_folder is the name of the folder containing your WordPress files. If you did not rename the unzipped WordPress download, the name would be “wordpress”.

    8) You should be greeted with the WordPress installation page – fill it out with the required information.

    9) Now go to your live site and download your themes and plugins – you’ll want to do this via SFTP or your control panel. Move these to the correct locations in your local development site (so MAMP/htdocs/name_of_wordpress_folder/wp-content/)

    10) Make sure to enable them by logging in to your local WordPress install and enabling the themes and plugins from the admin

    11) If you can, also go to your live server and download your uploads folder and place this into your local dev site (/MAMP/htdocs/name_of_wordpress_folder/wp-content/ again)

    12) On your live site, install a plugin like https://www.ads-software.com/plugins/wp-migrate-db/ (just temporarily – after we use it, feel free to remove). This plugin makes a copy of your live server’s database but prepares it to migrate to a different server by allowing you to run a find and replace. This find and replace will replace all the old urls and file paths of the live server with the correct urls and file paths of your local server. So for the file path of the local dev server you will likely have something like: /Applications/MAMP/htdocs/name_of_wordpress_folder

    13) It should download an SQL file to your desktop.

    14) Go to your MAMP PHPMyAdmin and select the WordPress table you created for your local dev site.

    15) Click the import tab in PHPMyAdmin and browse to the SQL file that was downloaded from your live site.

    16) PHPMyAdmin will then run through the SQL file and replace the local site’s database with the data from your live site’s database, obviously corrected to match the location on your local machine.

    17) You should now have a fully working clone of your live site running on your local machine for further development.

    Hope this helps!

    Thread Starter 80grit

    (@80grit)

    Hey bemdesign!
    Gonna give this a shot hopefully later tonight or early tomorrow.

    Just the prospect of a solution has got me Jacked!!
    And you’ve got detail, precious DETAIL – all numerically laid out.

    BEMDESIGN!….BEMDESIGN!…..BEMDESIGN!

    Will update.
    Grateful in Vancouver, Canada

    Thread Starter 80grit

    (@80grit)

    Hi bemdesign (or other folk with insight),
    I followed your steps 1 through 6 as instructed without problem.

    I downloaded WP v.3.7.1
    3.) created new database – kept it the same as the live server’s database.
    4.) unzipped WP v.3.7.1 and placed it in applications folder’s htdocs folder, unchanged as ‘wordpress’.
    5.) Filled out required info (database name same as live site), then ‘root’, ‘root’.
    6.) Saved edited file as wp-config.php.

    Then a glitch.
    7.) MAMP was up and running. Opened browser, pointed it to ‘localhost:8888/wordpress’ and got a 404 Error.
    Also tried ‘localhost:8888/MAMP/htdocs/wordpress’
    and ‘localhost:8888/htdocs/wordpress’
    All got the same 404 Error message.

    One additional change I did make was in MAMP’s preferences. I updated the Document Root to reflect the current status: ‘Applications/MAMP/htdocs/wordpress’. It was a different path prior to this change. After making this change, I stopped the MAMP servers then turned them on again.

    This part of the process was never a issue before. I can’t see how updating the Document Root to its current status would bugger things up.

    Ah, man! I’m so close to seeing the end. I’m like a pooch getting a whiff of biscuits and gravy.

    Fellow brethren, insights please.
    Thanks for helping me.
    B

    I am surprised localhost:8888/wordpress didn’t work! If you’re using the default MAMP settings it should…

    Okay open up MAMP and reset the document root preferences back to its basic default settings which should be: /Applications/MAMP/htdocs

    Also make sure the Apache and MySQL ports are set to the default MAMP settings of 8888 for Apache and 8889 for MySQL (this is done for security reasons – we don’t want your local dev site available to the whole world!)

    Then turn on MAMP and point your browser to localhost:8888/wordpress (if it works, great, if not, then we need to look into your wp-config.php file) or try localhost:8888/ and see what MAMP is serving up from the htdocs folder.

    Thread Starter 80grit

    (@80grit)

    Morning bemdesign
    Got to head out the door to work in a few minutes. Here’s an update.

    Worked on this for a few hours yesterday afternoon. I’ve made it through step 13. For some reason, it was nearly impossible to get through to the www.ads-software.com site yesterday to enter my post and to finally download migrate – late last night. Sheesh. Won’t be able to work on this till late tonight.

    Couple side notes:
    The person who designed this www.ads-software.com site a year ago didn’t include “plugins” and “appearances” in the Dashboard menu. Consequently, I don’t know how to accomplish your step 12 – migrate from the live site. Although, I did back-up the MySQL to my desktop a few weeks ago (the site hasn’t been active since the touring Broadway show finished it run, so nothing has changed on it).

    How can I accomplish your step 12 without using migrate?

    Thanks again for all your help. It’s appreciated more than you’ll know.
    See ya,
    Brad

    When you login to the live WordPress site, off to the left there should be a menu item representing plugins. If you’re an admin (i.e. have the Administrator role) you should be able to enable, disable, and install plugins. So you should be able to install and enable the migrate plugin I linked to *if you have the right permissions (i.e. user role)*.

    But if you can’t use the suggested plugin then follow these steps (in place of step 12).

    1). Using PHPMyAdmin on your live server (or another such tool) export your database (you’ve done this with your database backup I think).

    2). On your local server (MAMP) use PHPMyAdmin (or another such tool) to import your live servers database (that you previously exported). This may get a bit tricky and you may have to delete the previously created tables in the local wordpress database which were created when you set up your local development WordPress.

    3) Using PHPMyAdmin (or other similar tool) on MAMP, go to the WordPress database and find the options table (default WordPress installs would name this table wp_options).

    4) Inside this table, find and change the siteurl and home options to: https://localhost:8888/name_of_wordpress_folder

    5) Then download and install this URL find and replace plugin on your local site. After enabling this plugin do a find and replace to find all the urls and strings using the live servers urls and replace them with your local servers urls (so it would look for https://mydomain.com and replace it with https://localhost:8888/name_of_wordpress_directory/ throughout all your content). Basically it’s doing a MySQL search and replace.

    6) Your site should now be a functioning replica of your live site, the only exceptions being: a) it’s using a different url (meaning when it’s time to take your changes to the live server, you will need to migrate your file edits and data the other way!) and b) it’s local!

    bemdesign I am having an issue as well. I can follow step 1-6 but when i get to 7 i get a blank page once i enter localhost:8888/wordpress

    Im wondering if it may be my browser?

    @bdb5424: If you require assistance then, as per the Forum Welcome, please post your own topic.

    Thread Starter 80grit

    (@80grit)

    Hey bemdesign,
    I have successfully completed steps 3 and 4 (actually changed the siteurl and home options a few weeks ago. Changed them again recently to reflect the current path).
    Also partially completed step 5 – downloaded and successfully activated ‘Velvet Blues Update URLs’. However, I got an error message when I went to ‘Tools’, ‘Update URLs Now’.
    It reads as follows:

    ERROR: Something may have gone wrong.
    Your URLs have not been updated.
    Results
    0 Content Items (Posts, Pages, Custom Post Types, Revisions)
    Why do the results show 0 URLs updated?
    This happens if a URL is incorrect OR if it is not found in the content. Check your URLs and try again.

    Think I am hung up on step 2 of your last exchange to me.
    I didn’t delete tables first. (Sheepish grin) I essentially, imported the MySQL database into the one previously created with the same name as the live server’s database. I thought one would overwrite the other, if that makes sense. But you did warn me that I may have to delete the previously created tables. To delete tables do I simply check mark all the tables within a given database and then click ‘Empty’?

    By the way, these are identical MySQL files; They were part of the backup I did a few weeks ago. Given that, it’s puzzling to the uninitiated that there would be a problem.

    Hope you well and still feeling patient. ??
    See ya,
    Brad

    Thread Starter 80grit

    (@80grit)

    Hey bemdesign,
    Update. Tried again without success.

    I destroyed all tables within that database named after the one on the live server. I then imported a fresh one; made the changes to ‘siteurl’ and ‘home’ again. At one point after completing this, I was presented with another 5-minute WordPress install.
    This made me feel as if I was on the verge of a final breakthrough. Wrong.
    I’m in the same place.

    I activated all plugins, including ‘Velvet Blues..’, went to ‘Tools’ and clicked ‘Update URLs Now’. At at this point when I ‘Visit Site’ from the Dashboard I should see a complete backed up version of the live site on my localhost site, correct? Instead, I got the same Error message as in my last post to you.

    Things are getting kind of foggy. I’ve tried so many things and headed down so many gopher holes. Going to take a break, head to the gym and come back to this tonight.
    Jazz piano version of Charlie Brown’s, ‘Oh Christmas Tree’ is playing here in the Starbucks on the corner of Denman and Davie on a sunny, cold December afternoon in gorgeous Vancouver.

    See ya,
    Brad

    Okay. Let’s try this again. ??

    Step 2 is you go to the MAMP start page and click the PHPMyAdmin tab.

    Find the local WordPress’ database.

    Delete the tables for the local (select table, click delete (red x) to drop the table and its content).

    Then click the import tab in PHPMyAdmin.

    Click the browse button to locate the SQL backup file from your live site.

    Then click the GO button near the bottom to import the database.

    Proceed with the other steps I outlined previously.

    As to the URL update error – perhaps all your URLs have already been corrected, in which case you’re good to go. But double check your URLs and run it again just to be sure.

    Hello Bemdesign,
    I followed the steps you outlined above, and was successful up until the point of importing my database to the mamp phpmyadmin table. I think I must have not created the right find and replace links because now my site looks like a plain html file with any css or js loaded. These were the two folder that the wp-migrated-db plugin created automatically:
    //mckinleymarketingpartners.com
    and
    /home/mckinley111/mckinleymarketingpartners.com/html

    and I replaced them with the following:

    /Applications/MAMP/htdocs/Mckinley
    /Applications/MAMP/htdocs/Mckinley

    Can you tell me where I went wrong here?

    I reinstalled everything (had to rearrange the folders a bit and change the index.php), but now the homepage loads fine. However, when I click on any main navigation link it goes to a 404 not found page.

    the url looks like this:
    https://localhost/looking-for-work/

    If I put the main root in manually, the page will load:
    https://localhost/Mckinley-Marketing-Partners/looking-for-work/

    How do I set this up so that I don’t have to manually edit the links every time? I am using the following month and name permalink structure.

    hello,

    I want to backup my wordpress blog(in which 3 post are there) in localhost. i have done it successfully. i also change url(https://localhost/wordpress) in wp-options table in database.

    when i am trying to access in localhost(localhost/wordpress) it will successfully open index page without any error. but when i am trying to open any post description by clicking on post title it will redirect to localhost/xampp (xampp homepage) that means i can’t get any other page of my site except home page.

    plz help me.
    thanks.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘MAMP – localhost – mySQL database?..!’ is closed to new replies.