P*ssing in my WordPress Sandpit

For a while there, I had a sandpit environment for my parent’s webpage. The sandpit was a XAMPP install, running in a virtual Ubuntu machine via VirtualBox.  I eventually got around to an upgrade of VirtualBox, and the old snapshots wouldn’t play ball with the upgraded environment. So, the task I set myself tonight was to recreate the sandpit from the live WordPress install out at my ISP.  Turns out it wasn’t that simple to achieve.

First, I’ve been lazy with my Ubuntu kernel installs, and I’d forgotten which kernel I installed my latest VirtualBox with.  The first thing I did tonight was to purge all my unused kernels, and start with a fresh install of VirtualBox in the last kernel standing. To get get my monitors and desktop playing at full capacity, I needed the guest additions installed. Once I had a blank virtual OS with guest additions, I took my first snapshot (what a lifesaver when things stuff up, and tonight was full of reversions to previous snapshots).

Next, I laid down XAMPP, Freemind and Dropbox for locahost web-hosting, notes to self on all things web-page related, and easy file transfer across environments respectively, resulting in my 2nd snapshot.

Once that was done I needed the following in order (remember me saying I was backtracking alot?  The approach below isn’t exactly how the night went):

  1. dropped the entire WordPress directory zip file from my ISP into a new subdirectory of opt/lampp/htdocs
  2. Built a MySQL database and user to match what I’d set up at the ISP
  3. Imported the content of the live ISP database to the sandbox localhost database
  4. Modified the wp-config.php file to look at localhost instead of the ISP MySQL URL
  5. Switch off networking on the virtual machine briefly
  6. Step into the sandbox MySQL database, and modify relevant fields in the wp_options table so the sandbox environment wouldn’t go out to the live site and f**k it all up on me (the URL fields are the culprits)
  7. Switch networking back on within the sandbox, and whallah. Working copy from the live system that plays nicely.

And now I have a 3rd and final snapshot that I can try various shopping-carts out on before committing to a particular flavour.

I’ve learned tonight that the WordPress file backup and its matching MySQL backup go hand-in-hand for replicating the web-site across environments. I’ve also learned that the current backups sitting out at my ISP saved my bacon once I realised that the wp-admin screen in the sandbox was going out to the live site, and causing me to lock myself out of the live system, which suddenly thought its URL was based on a localhost address. DO NOT allow the sandbox to talk to the wider network until it’s happy to serve everything up locally Linds. JUST F**KING DON”T!

Might pour myself a stiff drink before I crash. Shaky nerves and all that jazz.

Advertisements

2 responses to “P*ssing in my WordPress Sandpit

  1. Wow. That shit sailed way over the top of my non-computer literate head!

    Like

    • Hey Dave.

      Probably should have a warning up front somewhere:

      Nerd alert: you will not be pampered. This is NOT a story about the littlest elf getting his jiggy over a lovely spring. Get your nerd on, princess.

      Notes from self to self is how I’ve decided to roll with the Blog. In all honesty, I’m not sure how many people out there would go to all this effort just to run up a “copy” of a live web-site. Then again, I trust the computer to f**k me up at exactly the wrong moment, so I try to head these things off at the pass where possible.

      I guess if you’re looking for a super-condensed version sans the nerdgasm, Ian M. Banks summed it up wonderfully with his Culture novel’s maxim: Superiority through redundancy. 😉

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s