{"id":169,"date":"2010-07-09T16:30:15","date_gmt":"2010-07-09T23:30:15","guid":{"rendered":"http:\/\/www.wellys.org\/wellysblog\/?p=169"},"modified":"2011-06-10T15:16:43","modified_gmt":"2011-06-10T22:16:43","slug":"riding-the-local","status":"publish","type":"post","link":"http:\/\/www.wellys.org\/wellysblog\/?p=169","title":{"rendered":"Riding the local&#8230; [UPDATED]"},"content":{"rendered":"<p>With the upgrade to Snow Leopard, I took the opportunity to make my MacBook Pro, a better development machine. This meant creating a Web server environment which matches my production shared hosting environment.<\/p>\n<p>Far easier said then done.<\/p>\n<p>I started with <a href=\"http:\/\/www.mamp.info\/en\/index.html\" target=\"_blank\">MAMP<\/a>. I wanted to have a complete server environment that is well supported by the community and was easy to maintain. I felt that MAMP met these goals better than going with the native OS X web environment. Apple hasn&#8217;t been the best at offering the latest stable release of Apache, MySQL (in fact, not supported at all) and PHP. MAMP offered all three plus PHPMyAdmin (handy at times) and a smattering of additional goodness.<\/p>\n<p>Using <a href=\"http:\/\/www.sequelpro.com\/\" target=\"_blank\">Sequel Pro<\/a> (a fantastic, freeware MySQL GUI), I was able to create the databases required for my films and WordPress. \u00c2\u00a0[A quick plug for Sequel Pro, they took the very nice code from CocoaMySQL and created a phenomenal tool. Well worth free, I gave them $50 for my copy, please donate if you can.]<\/p>\n<p>Changing the link references from my hosted version to a MAMP version wasn&#8217;t hard. Unfortunately, I wasn&#8217;t thinking clearly. Having a blank PHP page tends to do that&#8230; All the errors were mine. (Remember to put a closing slash on a directory link and MAMP references require a port number.)<\/p>\n<p>The hard part was duplicating WordPress. I finally kludged it by creating a fresh install of WP on MAMP then hand editing the WP database links to match my MAMP configuration. \u00c2\u00a0It&#8217;s working now but I&#8217;m worried about my first upgrade. I also had to go through my site and switch all references to a .com site to the localhost (MAMP) site.<\/p>\n<p>But at an absurdly high level to create a local WP site from a working hosted site:<\/p>\n<ol>\n<li>Install MAMP<\/li>\n<li>Fresh install WP onto MAMP site<\/li>\n<li>Copy the wp-content folder from the hosted site to the MAMP site<\/li>\n<li>Export the hosted WP MySQL database and import it into the MAMP MySQL database<\/li>\n<li>Hand edit the links in the &#8220;-options&#8221; table to match those required for the MAMP site (remember to edit the uploads option as well)<\/li>\n<li>Test. I turned off my wireless so I knew I was only local.<\/li>\n<\/ol>\n<p>As soon as I finish this post, I&#8217;ll need to figure out how I&#8217;m going to duplicate this entry locally. I have two options, one, I could copy the text from my post page into the post page on the local site or two, export the hosted MySQL db and import it in to my local site. The latter would require me to hand edit the options page again. (or I could try keeping it the same). Mmmmmm.<\/p>\n<p>UPDATE: Using two tabs on my browser, it took 30 seconds to duplicate the entry. Copy\/Paste, Copy\/Paste, click, click, click. That wasn&#8217;t so bad!<\/p>\n<p>UPDATE July 8th, 2010: As I migrated to WordPress 3.0 locally (went from 2.84 to 3.0), I needed to reacquaint myself with using WordPress locally. Here are the directions in greater detail in updating WordPress locally (this is a personalization of the detailed upgrade installation on the WordPress Codex):<\/p>\n<ol>\n<li>Backup MySQL database using Sequel Pro; File &#8211; Export &#8211; MySQL Dump (select all tables and make sure Drop Table, Create Table and Add Table Content are all selected. Use this backup to create  backup MySQL database for the backup old installation, I called it oldBackup. Use the Database Administration part of Sequel Pro to create a new database then Import the dump.<\/li>\n<li>Duplicate the oldblog directory using Finder &#8211; Duplicate then rename i.e; \u00e2\u0080\u009coldblog28\u00e2\u0080\u009d<\/li>\n<li>Verify new site works by doing the following:\n<ul>\n<li>Export only the wrp_options table using Sequel Pro<\/li>\n<li>Using Textmate, change all references of the blog directory to the new name i.e; oldblog to oldblog28 and (if necessary) make sure all www references are changed to local i.e; wellys.org:8888 to wellys.org:8888 (this is for MAMP running WordPress locally)<\/li>\n<li>In the oldblog28 wp-config file, change the name of the database to oldBackup<\/li>\n<li>Load the new site into Safari and confirm links are pointing to the new directory, browse the site a bit to ensure it is a fully working backup.<\/li>\n<\/ul>\n<\/li>\n<li>Back to the site being updated, deactivate ALL plugins.<\/li>\n<li>Download and extract the new WordPress package.<\/li>\n<li>On the old site, save the following:\n<ul>\n<li>wp-config.php<\/li>\n<li>wp-content folder but delete wp-content\/cache and wp-content\/plugins\/widgets<\/li>\n<li>wp-images (not found in oldblog)<\/li>\n<\/ul>\n<\/li>\n<li>Open two windows in Finder and delete all files but the above 6 a-c. Move the new WordPress files over to the old directory. Using this method, you can methodically ensure you are updating\/replacing all of the files. I had a little bit of work in the wp-content folder, making sure I didn&#8217;t delete any changes I had made to my blog.<\/li>\n<li>Log back into the blog and it should upgrade the database and site automatically. If unclear, go to: oldblog\/wp-admin\/upgrade.php<\/li>\n<li>Update .htaccess file if necessary (not necessary as of July 8, 2010)<\/li>\n<li>Install updated Plugins and Themes.<\/li>\n<li>Reactivate Plugins<\/li>\n<li>Add security key definitions to the wp-config.php file<\/li>\n<li>Review what has changed in WordPress.<\/li>\n<\/ol>\n<p>NOTE: Based on information from <a href=\"http:\/\/www.chrisabernethy.com\/why-wordpress-asks-connection-info\/\">http:\/\/www.chrisabernethy.com\/why-wordpress-asks-connection-info\/<\/a>, I changed the ownership of the oldblog to _www using: sudo chown -R _www oldblog<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the upgrade to Snow Leopard, I took the opportunity to make my MacBook Pro, a better development machine. This meant creating a Web server environment which matches my production shared hosting environment. Far easier said then done. I started with MAMP. I wanted to have a complete server environment that is well supported by &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.wellys.org\/wellysblog\/?p=169\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Riding the local&#8230; [UPDATED]&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[28],"tags":[8,32],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pvRD1-2J","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":197,"url":"http:\/\/www.wellys.org\/wellysblog\/?p=197","url_meta":{"origin":169,"position":0},"title":"DON'T HAND EDIT YOUR MAMP PHP.INI FILE!!!!","date":"December 27, 2009","format":false,"excerpt":"Oh, the agony. I spent the better part of a day trying to get Xdebug working on my MAMP site on my Mac. I read here, here and here... all you have to do is to \"edit your php.ini file\" and bada-boom! you are off to the races. No, no\u2026","rel":"","context":"In &quot;OS X&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":260,"url":"http:\/\/www.wellys.org\/wellysblog\/?p=260","url_meta":{"origin":169,"position":1},"title":"Well, that's unfortunate (Updated)","date":"June 5, 2011","format":false,"excerpt":"As I've said before, I've tried to keep a local version of my site mirrored to my online version. This isn't unusual for a lot of developers; it helps to stage your site, it allows you to make mistakes with little impact on the outside world and it allows you\u2026","rel":"","context":"In &quot;Wordpress&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":81,"url":"http:\/\/www.wellys.org\/wellysblog\/?p=81","url_meta":{"origin":169,"position":2},"title":"OK, now I get it","date":"May 16, 2009","format":false,"excerpt":"Spaces... didn't get it, didn't try it, til today. WOW! What a concept! In a nutshell, OS X has the ability to create virtual screens for you. You create a matrix of screens, assign applications to a specific screen then manage your work by going to specific screens. Yeah, it\u2026","rel":"","context":"In &quot;OS X&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":356,"url":"http:\/\/www.wellys.org\/wellysblog\/?p=356","url_meta":{"origin":169,"position":3},"title":"I LIKKKKKKKEEEEEEE it!","date":"July 6, 2011","format":false,"excerpt":"Wordpress 3.2 is lovely! I like the look of the new Dashboard, very clean and easy on the eyes! I had a brief delay in upgrading as I was on a older server and needed to upgrade to new one at my hosting facility. (note to self, 12 comes after\u2026","rel":"","context":"In &quot;Wordpress&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":142,"url":"http:\/\/www.wellys.org\/wellysblog\/?p=142","url_meta":{"origin":169,"position":4},"title":"Thanks, Norman!","date":"July 26, 2009","format":false,"excerpt":"I was thinking this, and was going to write about it but I didn't have the depth of experience to make the point as clear as Norman does. In his blog, Hollyn-wood (Norman, that is), Norman makes the point that the price cuts and the focus on ease of use\u2026","rel":"","context":"In &quot;Video&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":20,"url":"http:\/\/www.wellys.org\/wellysblog\/?p=20","url_meta":{"origin":169,"position":5},"title":"CrumplePop","date":"May 2, 2009","format":false,"excerpt":"CrumplePop: Hand-drawn Master Templates for Final Cut Pro. Saw the demos, had to have'em. Can't wait to use this in a project. High quality labels to put into your FCP video. They also have a Polaroid film template that is free but I'm waiting to get the link....hurumph.","rel":"","context":"In &quot;Video&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=\/wp\/v2\/posts\/169"}],"collection":[{"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=169"}],"version-history":[{"count":12,"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions"}],"predecessor-version":[{"id":339,"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions\/339"}],"wp:attachment":[{"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wellys.org\/wellysblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}