Dump A MySQL Database To YAML Using PHP

The Problem

I was recently working on a project that is built on WordPress / BuddyPress. I built up some content using the CMS features of WordPress in my development server and then I transfered the WordPress content to a beta server using the export/import functionality. That kind of stinks having to do that every time I want to push updates to my beta server. So I looked into using Doctrine to generate data fixtures which I could repeatedly run against the different database. Doctrine supports YAML files, which are extremely easy to edit by hand, so it seemed like a good idea.

So what’s the problem? Well, I didn’t currently have any of my data in YAML files. I didn’t want to had edit them or do some sort of copy and paste madness. So, I wrote a script in PHP to dump my data into a YAML file.

Read moreDump A MySQL Database To YAML Using PHP

Upgrade Time : WordPress 2.9 and MySQL 5

WordPress 2.9 was release somewhat recently and so like a good WP minion I logged into my site and clicked the update button. Error… uh oh. Apparently WordPress 2.9 requires a more recent version of MySQL (>= 4.1.2). My host installed MySQL 5 ages ago but I’ve never bothered with migrating to the new version because I didn’t have a reason to. Now I do. So here’s how my upgrade went.

First I made a full backup of both the web content and the MySQL database. The MySQL database backup was just a mysqldump command like so:

Read moreUpgrade Time : WordPress 2.9 and MySQL 5

How To Manually Merge WordPress Tags

With the advent of “tags” in the WordPress blogging platform there have been several very good plugins introduced which can handle management of your tags. This includes merging tags. Why Would I Want To Merge Tags? One word… duplicates. In my case I created a tag for my Friday Song Of The Day posts. The …

Read moreHow To Manually Merge WordPress Tags

How Do I Get Meta Data From MySQL Using PHP?

I know you’ve all asked that question before, right? Well maybe not, but I recently had the need to detect what the DATATYPE for arbitrary columns in arbitrary tables were inside a MySQL database using PHP. Turns out that it isn’t all that hard to get. The main thing about using this method is that …

Read moreHow Do I Get Meta Data From MySQL Using PHP?

Where Did My Categories Go?

To tag heaven. Ah, yes… tags. The teacher’s pet of Web 2.0. The category list on this blog had become rather unwieldy as I just plugged in new categories whenever I did not feel like putting any thought into organization. I never really liked that method and so when WordPress implemented tags I figured I’d …

Read moreWhere Did My Categories Go?