Skip to content

Migrate from Decap or Sveltia

Decap and Sveltia store content as markdown files in your repository and edit them through a config.yml. Menestrel replaces that pair with an API and an admin, while your site stays 100 % static. The migration is mechanical: your collections map to cms.config.ts, your files import with menestrel import, your components keep working through the loader.

This guide was written from a real migration: a five-singleton showcase site with 23 images, done end to end in under half an hour.

  1. Connect the site

    Terminal window
    npx create-menestrel@latest # or, in an existing site:
    npx menestrel init

    init detects Astro, writes your token to .env, creates a starter cms.config.ts and wires content.config.ts to the Menestrel loader.

  2. Translate config.yml into cms.config.ts

    Each Decap/Sveltia collection becomes a collection() (or singleton() for files: collections); each widget maps to a field builder:

    config.yml widget cms.config.ts
    string fields.text()
    text fields.textarea()
    markdown fields.richtext()
    number fields.number()
    boolean fields.boolean()
    select fields.select({ options })
    datetime fields.date() or fields.datetime()
    image fields.image()
    list fields.repeater({ fields })
    object fields.group({ fields })
    relation fields.relation({ to })

    Then push the schema: menestrel sync (the diff is shown before applying).

  3. Import the content

    Terminal window
    menestrel import --dry-run # scan and map, writes nothing
    menestrel import # entries, then images, then publish

    The importer reads your markdown frontmatter and bodies, uploads the referenced images, waits for their processing and publishes. Localized files (title.fr, suffixed files) land as per-field locales.

  4. Swap the rendering

    Your templates already read getCollection(): they keep doing exactly that, through the Menestrel loader. Replace direct <img> of repository files with <CmsImage /> and markdown rendering with <RichText />, then:

    Terminal window
    menestrel pull && npm run build
  5. Clean up

    Remove public/admin/, config.yml and the git-gateway backend. Your editors sign in at your Menestrel admin from now on; the repository stops receiving content commits.