It has been a while since I have posted anything here, so lets start with the website itself. If you are reading this post, you are looking at a freshly upgraded Drupal 11 site that was migrated from Drupal 9 — and the entire process was done with AI assistance using Claude Code, Anthropic's command-line AI tool.
I've written about website updates and layout changes before, but this was a completely different beast. This wasn't just a theme swap — it was a full major version upgrade across two major Drupal releases, with a database migration, theme replacement, module cleanup, server reconfiguration, and content fixes. And I did it in a single evening, working alongside an AI agent that handled most of the heavy lifting.
Why the Upgrade Was Needed
The site had been running Drupal 9.5.11 since... well, longer than it should have been. Drupal 9 hit end-of-life, which meant no more security patches. The site was also a mess — duplicate modules installed in multiple locations, no configuration management, a fixed-width 950px theme that looked like it was from 2010 because it was, and a pile of contrib modules that weren't even being used. An in-place upgrade would have been painful, so a fresh install with content migration was the way to go.
How I Used AI (Claude Code)
Claude Code is a command-line tool that connects an AI agent directly to your terminal. It can read files, run commands, edit code, search the web, and work through multi-step problems. I gave it access to my server, explained what I wanted, and we built a plan together. Here's what it actually did:
Planning
I described the current state of the site — Drupal 9, the modules I was using, the content types, the hero video on the front page, the mess of duplicate modules. Claude analyzed the site structure, read the database, checked module compatibility with Drupal 11, and produced a detailed phased migration plan. It identified which modules to keep, which to drop, and which had no Drupal 11 release.
Server Preparation
Drupal 11 requires PHP 8.3+, and the server was running an older version. Claude figured out the PHP upgrade path and identified the specific web server configuration that needed to be updated. I ran the privileged commands manually since I didn't give it root access, but it told me exactly what to run and in what order.
The Migration Approach
This is where it got interesting. The original plan was to use Drupal's built-in migration framework (migrate_drupal) to pull content from the D9 database into a fresh D11 install. Claude set up the new Drupal 11 project with Composer, installed the contrib modules, and configured the site. But when it tried to run the migration, it discovered that migrate_drupal only supports Drupal 6 and 7 as source databases — not Drupal 9.
So it pivoted. Instead of using the migration framework, Claude came up with an alternative approach:
- Clean up the D9 database by uninstalling all incompatible modules directly in the D9 site
- Dump the cleaned database
- Import it into the D11 database
- Run
drush updatedbto apply all the schema updates from D9 through D10 to D11
The cleanup phase was extensive. It had to uninstall over 30 modules in the right order, handling dependencies. Paragraphs module couldn't uninstall because it had content — so it deleted the paragraph entities first, then the field storage, then the module. It removed deprecated core modules like Quick Edit, RDF, and CKEditor (replaced by CKEditor 5 in D10). It switched the D9 site's theme to Olivero and admin theme to Claro before removing all the old themes. All of this was done through drush commands.
After the cleanup, the database import and drush updatedb ran through hundreds of update hooks across two major versions. There were some hiccups — a missing database table here, a schema conflict there — but Claude diagnosed and fixed each one as it came up.
Theme and Front-End
The old site used an outdated fixed-width theme that was never responsive. For the new site, we initially set up an Olivero subtheme, then switched to the Tara theme when I decided I wanted something different. Claude created a subtheme, added the hero video template (porting it from the old theme), wrote responsive CSS for the video and embedded iframes, and configured a color scheme — white background, dark gray text, blue accents.
One interesting challenge was that Tara's .theme file hardcodes the theme name in all its theme_get_setting() calls, so settings configured for the subtheme weren't being read. Claude caught this and created a .theme file for the subtheme that overrides all the preprocess functions with the correct theme name.
Content Fixes
After the migration, a lot of the content had issues:
- Broken image URLs — The old site had been configured differently at some point, so image URLs embedded in the body text were pointing to incorrect paths. Some were full absolute URLs with the old domain hardcoded. Claude ran SQL operations across the content tables to normalize all the image paths.
- Missing files — Several directories of uploaded photos hadn't been copied during the initial file migration. Claude identified which ones were missing by checking the file references in the database and copied them over.
- Gallery functionality lost — The old site used the EVA (Entity Views Attachment) module to display photos on gallery pages. That module was uninstalled during cleanup because it wasn't compatible. Claude recreated the gallery functionality by building a new Views block with a contextual filter on the gallery entity reference field, placing it on gallery content type pages.
- Colorbox not working — The Colorbox jQuery library was using APIs that were removed in jQuery 4.0, which ships with Drupal 11. Claude identified this by checking for deprecated jQuery calls in the source, then downloaded an updated fork that's compatible with jQuery 4.
- Broken HTML in content — At least one post had a malformed HTML tag after a YouTube embed, causing elements to render on top of the video instead of below it. Claude found and fixed the markup.
Server Cutover
Switching the live site over to the new install required updating the web server configuration. There were several rounds of troubleshooting — configuration issues, permission problems, and compatibility settings that needed adjusting. Claude wrote the new configuration and worked through each error as it came up, reading server logs to diagnose the issues.
What I Learned
A few takeaways from doing a major CMS upgrade with AI:
AI is great at the tedious parts. The module-by-module uninstall process, the SQL operations, the config file generation, the view creation with all its nested YAML — these are things that would have taken me hours of Drupal admin UI clicking and documentation reading. Claude did them in seconds with drush commands and direct config manipulation.
It adapts when things break. The migrate_drupal dead end could have derailed the whole project. Instead of me having to research alternative migration strategies, Claude identified the limitation, proposed the database import approach, and executed it. When individual update hooks failed, it diagnosed the specific issue and applied targeted fixes.
It doesn't replace understanding. I still needed to make decisions — which theme, which modules to keep, what the color scheme should be, how the galleries should work. And I needed to run the privileged commands and verify things looked right in the browser. The AI handled the execution, but the direction was mine.
It's not perfect. Some things needed multiple attempts. API changes between Drupal versions caused unexpected errors, and not every first attempt worked. But Claude recovered from each of these quickly, diagnosing the issue and trying a different approach.
The Numbers
- Drupal 9 → Drupal 11 (skipping D10 entirely)
- 259 nodes migrated successfully
- 74 photos across 6 galleries, all working with lightbox
- 30+ incompatible modules removed
- PHP upgraded to meet Drupal 11 requirements
- jQuery 3.x → jQuery 4.0 (with library compatibility fixes)
- Fixed-width 950px → fully responsive
- Done in one session
The site is now on a supported version of Drupal with proper dependency management and configuration tracking. That's a big deal for maintenance going forward.
If you're sitting on an old Drupal site that needs upgrading and the thought of doing it manually is keeping you from starting — give the AI-assisted approach a try. It won't do everything for you, but it makes the painful parts a lot less painful.