Purujit Vij
← all work

case study ·

From $75+ to ~$15 a month: moving a live news CMS off Strapi Cloud with zero downtime

A news publisher was paying $75+ a month for Strapi Cloud, plus overage charges, with no logs when something broke. I scoped a move to its own AWS account, moved 2,100 articles and 39,000 media files with zero downtime for about $15 a month, and closed a security hole that wasn't in the brief.

  • Strapi
  • AWS EC2 · S3 · IAM
  • SQLite
  • GitHub Actions
  • Security
Role
Client work, end to end. Scoping, migration, security and deploys
Published
20 Nov 2026
Read
10 min

the results

  • $75+ → $15monthly hosting bill, and no more API overage charges
  • 0 minwebsite downtime during the move
  • 13 → 0critical vulnerabilities after the Strapi upgrade
  • 44public permissions closed

What the client needed

A news publisher ran its website on Next.js on Vercel, with Strapi 5 on Strapi Cloud as the CMS behind it. It had three problems with that setup:

  • The bill. $75+ a month for the plan, plus overage charges whenever API traffic went past the plan’s limit, so a busy news day cost extra.
  • No logs. When something failed, there was nothing to look at.
  • No control over the server, its upgrades or its security.

The brief was to move the CMS to the publisher’s own AWS account for a fraction of the cost. Under the brief were three things that mattered more than any tool choice:

  • The website can’t go down. It’s a news site.
  • The news can’t stop. An import tool posts new articles twice a day, and it kept doing so during the move.
  • Subscribers can’t notice. A hook syncs every new subscriber to the newsletter tool, so a careless copy would have created duplicates or sent them emails.

What had to move: 2,094 articles, about 14,800 entries with 36,800 relations, and 39,453 media files (7.4 GB).

What I scoped, and what I left out

The cheapest setup that met those three conditions was one small server. Most of the scoping was deciding what not to build.

Decision Why
One EC2 instance with 1 GB of RAM, and SQLite A CMS with few writes, on one server. Postgres would have taken most of the memory.
No RDS, no second server, no load balancer The traffic doesn’t need them, and if the API goes down the website keeps serving cached pages. If the site grows, those are the next steps.
Keep the frontend on Vercel Moving it onto the same server would save at most Vercel’s $20 a month, put certificates, DDoS protection and patching on the publisher, and let one failure take down everything.
systemd and Caddy Both handle the routine work themselves: systemd restarts Strapi on a crash, starts it on boot and keeps the logs; Caddy fetches and renews HTTPS certificates in a 15-line config.
A new cms subdomain Everything could be tested on the new server while the live site kept using the old one.

That last row is the whole zero-downtime plan. The website didn’t touch the new server until the very end, and switching back would have been one vercel rollback.

The move

Strapi listens on 127.0.0.1 only, so Caddy is the only way in. I left the newsletter tool’s API keys empty until the copy was done, so the copy couldn’t create duplicate subscribers or send emails.

The transfer died halfway through the media

Strapi’s transfer command copied the content in 80 seconds, then Strapi Cloud closed the WebSocket after 4,838 files (2.3 GB). The transfer failed and the database rolled back to empty. Getting that far had already needed a workaround: Strapi 5.23’s CLI ignored the --from flag, and reading its source showed it would take the URL and token from environment variables instead.

So I split the job in two:

  • Content with strapi transfer --exclude files: 80 seconds, and safe to repeat when new articles arrived.
  • Media with my own downloader. It pulls all 39,410 file URLs (originals and resized versions) from the database and downloads 8 at a time, retrying with exponential backoff. Each file is written as .part and renamed only when complete, and files already on disk at the right size are skipped, so a crash just means running it again.

The first run flagged 2,117 good files as broken. Strapi stores sizes in kilobytes of 1,000 bytes, and I had compared with 1,024. After that fix: 34,572 files downloaded, 0 failures, and all 2,475 images linked inside article bodies checked.

The server couldn’t build Strapi’s admin panel on 1 GB: it ran out of memory, and with a bigger heap it sat in swap for over 13 minutes. I built it on my laptop and copied it over, and later moved the build to GitHub Actions, where it takes about 40 seconds.

The cutover

Before switching, I read the frontend’s code to see exactly which endpoints and relations it used, and made an API token that can read public content and create only contact and subscribe entries. Then I changed the Vercel environment variables and redeployed the same build.

One surprise: the live frontend was older than its repo and read three more content types. They returned 403 until I added them to the token.

What I found that wasn’t in the brief

Moving a CMS means reading every permission, dependency and row, so problems turn up. Some had been there on Strapi Cloud all along. Others the move itself caused. I told the publisher about each hole while I was closing it.

Anonymous visitors could read subscriber data

While auditing roles I found that anonymous visitors could read private collections, including subscriber and contact-form data, and could edit and delete articles. Anyone could also sign up. All of this was already true on Strapi Cloud.

This couldn’t wait for a later phase. I saved the existing permissions as JSON, backed up the database and removed 44 of them. To prove the lockdown worked without touching real data, I sent deletes with IDs that don’t exist: 403 means no permission, 404 means permission but no such item. I also closed public signup, revoked Strapi’s unused default tokens, and rotated the frontend’s token without downtime: create the new one, update Vercel, redeploy, then revoke the old one.

13 critical vulnerabilities

npm audit flagged 13 critical issues in Strapi 5.23. The upgrade tool only bumped 3 packages, because overrides in package.json pinned the rest. After fixing the overrides, I ran the upgraded Strapi on a second port against a snapshot of the live database and compared a hash of every API response with production. The only difference was one new field, focalPoint.

Then the real switch: back up, swap the code folder (keeping the old one for rollback), start, and let the migrations run. Strapi 5.23 → 5.62, and 13 → 0 critical vulnerabilities.

Articles started showing another article’s images

After the move, some articles showed images from months-old articles. Comparing backups with the live database, each affected article had two image links: the right one and a stale one. The duplicates were already in the Strapi Cloud data. Postgres happened to return the right row first. SQLite returned the other one, because nothing asked for an order.

The rule that separated them: keep the image uploaded in the same minute the article was created. That split all 4,180 news cases cleanly. After a backup, in one transaction, I removed 4,218 duplicate links and 4,595 orphaned ones. 328 of the orphans would have attached themselves to future articles. 22 unclear newsletter cases went to manual review instead of a guess.

A redirect that dropped the token

The import tool still posted to the old CMS hostname. A 308 redirect keeps a POST a POST, but clients drop the Authorization header when a redirect crosses to another host, so the tool has to call the new hostname directly. The old hostname also still pointed at the deleted Cloud project, which is a subdomain-takeover risk, so it now points at the server and redirects.

What the publisher has now

Media off the server’s disk

The images lived on the server’s disk, next to the code, where one bad rm or a disk failure could lose the whole archive. I moved all 39,464 files to S3:

  • The server reaches the bucket through an IAM role, so there are no access keys to leak, and IMDSv2 is enforced.
  • The bucket allows public GetObject only. Listing, upload and delete return 403.
  • Files get a one-year immutable cache header, since every file name is unique.
  • Old /uploads/* links get a 301 to S3, so links in old newsletters still work.

Images loaded faster from S3 than from the server: 0.25 s against 0.63 s. The PDF reader, though, said “Unable to load the PDF.” An <img> tag doesn’t need CORS, but the reader fetches the PDF with JavaScript, and the bucket sent no CORS headers. A CORS rule that allows GET and HEAD from the site’s own origins, and exposes the range headers a 41 MB PDF needs, fixed it.

Deploys without SSHing in

A merged pull request now deploys itself. GitHub Actions builds the admin panel and sends it over SSH to a key that can run exactly one script (a forced command= in authorized_keys). The script:

  1. backs up the database,
  2. checks out the exact commit that was built,
  3. runs npm ci only when the lockfile changed,
  4. swaps in the new build and restarts Strapi,
  5. waits for a health check, and rolls everything back if any step fails.

11 tests cover it, including an SSH connection dropping in the middle of a rollback. With the build off the server, Strapi needed about 650 MB including the OS, so the instance went back from 2 GB to 1 GB.

The bill

Strapi Cloud AWS now
Monthly cost $75+ for the plan about $15 for everything
API overages Extra charges past the plan’s limit None. Traffic stays inside AWS’s 100 GB free monthly transfer
Logs and control None Full: journald, access logs, SSH

The $15 covers the server (about $8), its 20 GB disk, a fixed IP, a week of disk snapshots and S3. That’s roughly 80% less every month, with no surprise charges when a story gets busy. Backups are a nightly database copy, a week of disk snapshots and versioning on the media bucket.

“Zero downtime” means the website. The API was down for a minute or two during the Strapi upgrade and a kernel reboot, and the admin panel for about 10 minutes when I ran a build in the live folder. Readers kept getting pages from Vercel’s cache the whole time.

Next, once AWS verifies the new account: a CDN in front of the media, with the bucket made private.

What I learned

  • Start from what the client can’t lose. The site staying up, the news arriving and subscribers getting no stray emails shaped the plan more than any tool choice.
  • Say what you won’t build, and why. One server, no RDS, the frontend left where it was. Each “no” kept the bill near $15, and each has a clear next step if the site grows.
  • A migration is a security audit whether anyone asked for one or not. You read every permission anyway. Fix what can’t wait, tell the client while you fix it, and test without touching real data: a fake ID gives 403 against 404.
  • Test on a parallel hostname. It’s what made zero downtime cheap.
  • Make big copies resumable. Split content from media, write to a temporary name, rename when done, and skip what’s already there.
  • Databases don’t promise an order unless you ask for one. Changing engines can surface bugs that were always in the data.
  • Moving media? Check what JavaScript fetches. PDFs, fonts and video players need CORS. <img> doesn’t.
  • Never build in place on production. I learned this one by deleting the live admin build mid-build, and restoring it from a backup.

let's talk!

Hiring for AI or platform engineering?

I like ambiguous 0→1 problems: turning them into clear system designs, and shipping software that behaves safely in production.