Migrating content to PostgreSQL

In a quest to reduce reduce duplicate functionality on my VPS (and gain some RAM space for better uses), I have decided to consolidate my database services on PostgreSQL. The problem: WordPress is very MySQL-centric — it does not currently support, and probably never will support PostgreSQL (or other databases). This is understandable: MySQL's "be liberal in what you accept" philosophy encourages less-than-portable SQL to proliferate — and once you have a successful MySQL-bound codebase, it's hard to justify the cost of rewriting it for portability.

As it turns out, there is a plugin (PG4WP) that enables WordPress to run over PostgreSQL. It does so by replacing the wp-includes/wp-db.php database abstraction layer with a PG-specific one — which means the author must revise it for every new WordPress version. It currently supports WordPress up to 3.2.1, the previous WP release as of this writing.

As with any piece of software developed by a single author and used by a relatively limited audience, there are no guarantees about the future of the project. But even if that could be overlooked, there's a bigger problem: it's doubtful that other plugins will work with a PostgreSQL back-end, as few if any authors will test outside of MySQL.

I have therefore started to look for other CMS options that are more PostgreSQL-friendly (at least in their descriptions), while also having a large community and being under active development. After looking around I have decided to try Drupal, a popular PHP system that claims to support several databases.

I will talk about the technical details in another post; to make a long story short: it took more time and effort than I expected, but it worked. I was able to closely reproduce the original WordPress site in Drupal running over PostgreSQL.

Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.