Our last upgrade was routine by design: no database changes and one line of code. emDash 1.5 was different. It brought six database migrations, the first since 1.1, and on this site one of them needed the site taken offline for a few minutes.

We upgraded on November 19, eight days after the release. The routine was the same as last time. What changed was the planning around the migrations, and what the upgrade turned up along the way:

  • two problems in our own code that 1.5 made visible
  • one in how 1.5 renders images

The recovery point, before anything else

As last time, we secured the four things an emDash site is recovered from, set out in operating emDash safely:

  • the database
  • the media
  • the encryption key
  • the running version of the code

This time it wasn't a formality: forward-only migrations mean the only way back is restoring the database and the code together.

  • An off-platform copy of the database. We ran the encrypted weekly backup by hand just before the window: 1.28 MB, stored outside Cloudflare.
  • A point-in-time bookmark. Our deployment records one automatically before it applies any migration, and it did.
  • A named rollback target. We noted the version of the site running in production.

The updater, and a familiar error

emDash's updater again did the mechanical part and wrote the work order. It covered:

  • four packages: emDash and its Cloudflare adapter to 1.5.0, the forms plugin to 0.2.13 and the embeds plugin to 0.1.59
  • 120 changelog entries
  • the six added migrations, each by name

The first two runs failed, for the third release running. One failure was the same stale package-registry cache as before, and clearing it for emDash's packages fixed it. The other was a burst of dropped connections to the registry, which a lower download concurrency got past. Neither had anything to do with the release itself.

Reading the work order

Of the 120 entries, these are the ones that touched this site:

ChangeApplies here?What we did
Plugin storage unique indexes rebuilt (migration 095)Yes: our newsletter plugin declares oneA maintenance window, described below
Sandboxed plugins' stored data copied to a shared store (migration 092)No sandboxed pluginsNothing
emDash and the Cloudflare adapter must match exactly; one shared admin component versionYesFound and removed three hidden copies, below
Structured data gains stable identifiersYes: we publish our own organisation dataAdded a check, which then caught a mismatch
Bluesky embeds rendered by BlueskyConfiguration onlyRemoved a build setting that no longer applied
Configuration options type-checkedCheckedOurs passed unchanged
Real-time co-editingOptionalLeft off for now

Three copies of emDash we didn't know we had

The release now insists that a site runs a single copy of emDash, so we checked. After the updater ran, our project held three versions:

  • The site: 1.5.
  • One of our own plugins: 1.4.
  • Two others: a shared copy of 1.2.

Each plugin had declared a loose version range, and the package manager had quietly settled each on its own copy at some point in the past. It mattered more than it sounds. Our newsletter plugin reports errors using a class from its copy of emDash, not the site's, so the core may not recognise them as its own.

The fix was to raise the plugins' declared range to 1.5. After reinstalling, every plugin resolved to the site's own copy, and 66 duplicate packages disappeared. If you maintain your own plugins, check how many copies you have: pnpm why emdash lists them.

The maintenance window

Why we needed one. Migration 095 rebuilds the uniqueness rules that plugins declare for their stored data. Our newsletter plugin has one, which keeps each confirmation link's token unique. emDash's upgrade guide is explicit: don't run this migration while the old version is still serving, because an old instance can recreate the old rule straight after.

Our deployment normally applies migrations and then switches to the new code, with the old version live in between. That's exactly the order the guide warns against, so for this one release we made sure nothing old was running.

What we checked first.

  • Duplicates. A read-only query showed the newsletter's pending sign-ups were empty, so the migration couldn't stop on duplicate tokens.
  • A rehearsal. We ran all six migrations against a copy of our local data. The newsletter rule came out scoped to its own collection, as the release describes, and every page still rendered.

What we did. The whole window lasted a few minutes:

  1. Blocked traffic at Cloudflare. A firewall rule turned visitors away while still letting our own network through.
  2. Paused the scheduled tasks. We removed the every-minute trigger so nothing old could wake up. The deployment restores it from the site's configuration.
  3. Waited a minute for anything in flight to finish.
  4. Merged the change. The deployment recorded its bookmark, confirmed it was talking to the production database, listed the six pending migrations, applied all six, and deployed.
  5. Reopened the site. The post-deploy check had failed while visitors were still blocked, which we expected because it loads the home page. We re-ran it once the site was open, and it passed.

What the preview caught

1.5 gives emDash's own "publisher" entry in each page's structured data a fixed identifier, so a site's own organisation details can merge with it. We already publish ours with the same identifier, so we added a check that every page carries exactly one.

On the private preview, the check failed. emDash built its identifier from the address the preview ran on, while ours used the site's real address. A search engine reading that preview would have found two publishers on every article. Passing the site's address to emDash explicitly, one line in our page layout, made them agree everywhere. Production would have been fine either way, because both addresses are the same there. The preview is what made the difference visible.

What production showed

The deployment's checks passed. Then we looked at the home page, and every card image sat in the top of its frame with a band of background below. At phone width, only one image out of sixteen filled its frame.

The cause was a change in 1.5, revealing an older gap of ours. emDash only resizes images when it knows the site's address while the site is being built, and ours didn't. So emDash 1.4 had been serving the full-size original at every width all along; we'd noted as much weeks earlier. It still rendered those images the way our styles expected. 1.5 notices that the image can't be resized and falls back to a plain image element, with a height rule of its own that our styles didn't override.

One line of CSS restored the frames, and we confirmed every image filled on the home page, a category page and two articles, at phone and desktop widths. The fix took one pull request. The underlying gap is still open: properly resized images would load faster, but each size is a billed image transformation on Cloudflare, so that's a decision for its own day.

6migrations applied by the deployment, with none pending or unknown afterwards
66duplicate packages removed once every plugin shared one copy of emDash
1 → 16images filling their frames on the home page at phone width, before and after the fix

After the deploy

  • Media usage tracking was marked for re-indexing by the upgrade, as the release notes said it would be. With the settings page left open, it reached Ready.
  • Menus were unchanged. The migration that rescues orphaned menu items had nothing visible to move.
  • The newsletter's uniqueness rule is now scoped to its own collection on production, exactly as in the rehearsal.
An emDash upgrade with migrations0/8 done

When a release touches the database

  • Running an emDash site. Most releases are still routine, and 1.5 is routine for most sites. Read the upgrade notes for the one or two entries that ask for a window, and check your plugins against them before you pick a time.
  • Commissioning a site. Ask the builder how a release with migrations gets deployed: who closes the site, for how long, and how they'd roll back. A good answer names the backup, the order of steps and the check afterwards.
  • Running an agency. Keep a note of which client sites run plugins with unique storage indexes or sandboxed data. Those are the sites where an upgrade needs a booked window rather than a routine deploy, and the list will save you reading every changelog against every client.