Topics

The Story of Building a Backup Feature for microCMS

  • column

Hello, I'm Otsuka, CTO at Liberogic.

You've asked me to write an article, but I don't have much to say, so today I'll share a story from a while back.

In fact, more than a year ago, I built an internal backup system for microCMS.

microCMS does have backups for data protection, but there is no way to retrieve past data from the admin interface. As a safeguard against accidental data deletion, I started this project on a "well, let's just build it" whim.

A Brief Overview of How It Works

  • Created a program that performs backups using Cloudflare Workers
  • Triggered manually or via CRON
  • Uniqueness is ensured by endpoint + id + revisedAt
  • Data is managed as snapshots without duplication
  • Media files are saved together as well

Storage locations: articles are stored in Cloudflare D1, and media files in Cloudflare R2.

You can back up both article data and images together.

A system designed with recovery in mind

Backups are not just about "taking" them; what matters most is being able to restore when it counts.
"I want to revert to yesterday's state" or "I want to recover an article I accidentally deleted"
are the kinds of situations you can prepare for, and having that in place makes a real difference to your peace of mind during operations.

Summary

  • A backup system for microCMS, built in a Cloudflare environment
  • Save articles and content together and manage them as snapshots
  • A system that gives you peace of mind, including recovery

It's surprising how useful these kinds of tools turn out to be in day-to-day work: the ones we build simply because we need them ourselves.

Well then.

About the author

The backbone of Liberogic's technical division. Whenever he hears someone say, "I wish we had something like this, it would be so handy," he adds his own ingenuity, turns the idea into added value, and gets it implemented in no time. A highly sociable team member who has many fans among our clients, he is a treasured asset to our company and a devoted cat lover.

Sho Otsuka

Director, CTO / Chief Engineer / Representative, Nekoana LLC / Looks unreasonably young

View this staff member's articles

Consult with us about headless CMS

"I want to reduce WordPress maintenance burden"
"I want to review CMS and server operational costs"
"I want to manage multiple sites in one place"
"I want to migrate from an existing CMS to a headless CMS"
"I'm not sure which is better between microCMS and Kuroco"
"I want to consult on not just CMS but also frontend and Cloudflare together"
You can contact us at any of these stages.

Paying too much for overbuilt infrastructure and security measures? Feeling uneasy about WordPress?

Case Studies