Line drawing of a person on a ladder feeding a page into a server tower while a robot reads a printout next to a lime stop sign.
Illustration
JBJohn

Prepping a major Drupal upgrade from the server command line, with AI

A client's Drupal site needs a major upgrade, and Drupal isn't my background. Probing, cleanup and prep, with an AI on the other side of the paste.

A client's Drupal site needs a major version upgrade, and the version it runs now is close to end of life. The last major upgrade on this site, before my time, failed on its first production try and got rolled back.

Drupal development isn't my background, and server work at this depth is a big step past my old skills. So I set the work up to be careful. Here's how it's going.

How the work actually runs

The AI never touches the server. I remote into a jump box, SSH into the server, and paste commands one line at a time. Then I paste the output back. Claude reads it, explains it and writes the next step.

I run every command and make every call. Claude does the research, the command blocks, the runbook, before and after screenshots, and drafts of the emails to the server team.

Probing

Everything started read-only. Version inventory, what blocks the upgrade, security audits, the site's own status report. Nothing changed until the plan was approved.

The first real change was turning off outgoing email on the dev server, so testing could never email real users.

At one point I asked about some long encoded lines in the commands: "is this a dead giveaway im using ai?" Claude said it's a decades-old admin trick. Fine by me.

Cleaning

The big cleanup took one long day. One agent researched every module on both sites. A second agent checked that research and made 22 corrections.

Then we cleaned:

  • removed unused and abandoned modules
  • deleted hand-copied duplicate module folders, so everything is managed by the package manager
  • retired add-ons that were deprecated in the new version
  • cut a pile of user roles down to two

By the end of day 2 I asked, "where do we stand on your 1 month timeline at the end of day 2?? lol". About two weeks ahead, apparently.

Where the AI got it wrong

An uninstall ran out of memory and crashed. But the next lines I'd pasted ran anyway, and they moved module code out. Claude owned it ("That's my mistake"), restored the folders and reran with more memory.

That changed how we work. Now it's one command per line, with a STOP comment after anything that changes things. I check the output before the next line. It just works better for my brain.

Another time Claude proposed a wildcard delete on a path built from a variable. The permission prompt flagged it, and I told it to examine what it did. Nothing had run. It switched to writing into a fresh folder instead.

And a sneaky one: a routine database update step quietly broke most of the site's menu links until the caches were cleared. Now every database update is followed by a cache clear, and a deploy never ends on one.

Prepping

  • A backup before every batch of changes, plus one labeled "the rollback point."
  • Dev got to the new version step by step over 3 days.
  • An automated crawl compared hundreds of live pages against dev. No upgrade breakage.
  • Dev is frozen now. The deploy bundles are checksummed, and the QA scripts end with a rollback section that gets tested once on QA before production.

Where it stands

As I write this in mid-November, it is not on production yet. Both dev sites are done, and the upgrade has worked on the test server. Next comes a security scan, then an after-hours window with the server team.

What I took from it

  • Lead with evidence and a diagnosis. The fix belongs to the people who own the box. I hand the server team proof, not orders.
  • Same with security staff. They're the pros. I give status and ask what they need.
  • Never trust that the line before worked. One command, check, next.
  • Live server evidence beats old docs.
  • Promote whole tested checkpoints. Never cherry-pick modules.
  • Print only the config value you need, never the whole file. Those files carry passwords.

I asked Claude what job this work counts as. Its answer: a Drupal developer with release duties. "DevOps-adjacent." I'll take it.