budding · planted · tended

WordPress to Statamic, flat-file

All notes, by stage

My working notes from moving this site off WordPress to Statamic in October 2024. (It has since moved again, to a static build. The notes still stand for anyone doing the Statamic move.)

Starter kits are flaky

The starter kit picker at install is confusing. Some need a licence key without saying so; one failed outright with "Starter kit config does not exist". One worked, one installed without its pages. In the end I went with no starter kit and a vanilla theme.

Skip the first-party add-ons at install too. Install the SQLite driver even if you don't plan to use it.

Keep content flat-file

I'd already decided: content in plain text files, indexable and in git, until that gets fiddly. My first attempt also installed the Eloquent driver to keep content in a database because it seemed a good idea. Something broke, and migrated articles returned 404s. Flat first; Statamic's docs cover moving to a database later if you need to.

Getting the content out of WordPress

Export plugins and scripts were fine for flat content and not much else. What worked:

  1. Load the WordPress database dump into a local MySQL.
  2. Add Corcel to the Laravel app, a second wordpress database connection, and the right table prefix.
  3. Read posts, terms and meta as Eloquent models and write Statamic entries from them.

Copy the taxonomies first

Statamic names things differently from WordPress. Create the taxonomies with the right names and copy what exists before you import anything; otherwise you're hand-editing files full of UUIDs to fix references later. Then a Posts collection and a blueprint with every field the old posts had.

Still on the list at the time: comments (Meerkat looked promising and its validation utility is a nice touch), images, and keeping every old URL working.

The why, rather than the how: goodbye WordPress, hello Statamic.