From Tina
A Tina site on Astro can be ported onto CaraCMS: its content is converted by a script, its components are rewritten so text can be typed on the page, and visitors see the same pages before and after.
Read Porting a site first for the shape of the work.
Which sites this fits
The site | What it takes |
|---|---|
Tina on Astro | A port, as this page describes. It doesn’t matter whether the site uses Tina Cloud or hosts Tina itself. |
Tina on Next.js | A rebuild, not a port. CaraCMS runs on Astro only, so the pages are rebuilt in Astro first. The script can still convert the content and move the images. |
What the script converts
The conversion script reads Tina’s own generated schema and the site’s content files. Nothing in it is written per block or per site, beyond a short table of choices at the top.
In the Tina site | What happens |
|---|---|
Content as Markdown or MDX with YAML frontmatter | Converted. The frontmatter becomes fields, the body becomes rich text or blocks. |
Content as JSON | Converted. |
Section builders (a list of templates) | Each template becomes a block. |
Images in the repo, under public/ | Uploaded to the site’s media and named by their new keys. |
Images on another site, such as Cloudinary | Fetched and uploaded, when you run the script with --fetch-images. Without the flag they’re left out, each named in a warning. |
References, links, dates, lists and groups | Converted to the matching field. |
TOML or JSON frontmatter | Not converted. Each file is named in a warning. |
The script never drops something without saying so. Anything it can’t carry over is named with its file and line.
Post bodies
CaraCMS rich text holds paragraphs, two levels of heading, lists, bold, italic and links. A typical post body holds more: pictures, code, quotes, tables.
So the script decides per collection. Where every body fits in rich text, the body stays one rich-text field. Where any body holds more, every body in that collection becomes a list of blocks: text, image, code, quote and table, plus a block for each MDX component Tina’s schema declares.
A dry run tells you which collections go which way, before anything is decided.
Before you start
- A quiet site. Agree a day when nobody edits in Tina. Content changed after the conversion has to be carried over by hand.
- A built checkout of the Tina site’s main branch. The script needs the schema Tina generates when the site builds.
- Where it will run. CaraCMS Cloud or Standalone, and the key or bucket credentials for it, so images can be uploaded.
- Astro 7. The Astro bump is done first, on its own, and checked before anything else changes.
What you’ll be asked to approve
Before content moves, your agent should bring you one list to approve:
- The block table. Each Tina template, the CaraCMS block it becomes, and its name in the editor.
- Which collections’ bodies become blocks, and what happens to anything the script warned about.
- Fields edited in the sidebar only, such as display text fitted to its box.
- What gets re-modelled for the editor once the pages match.
The order
Bump Astro, on its own commit, and check the site still looks the same.
Remove Tina: its folder, its packages, its admin and the routes that read from it.
Delete the old content folder. Git keeps it, and the script reads from the checkout of main.
Switch to the Node adapter in standalone mode. A static site gets an adapter now.
Run caracms init with the site’s mode.
Copy the conversion script into the site and run it against the built checkout.
Rewrite the blocks, the page component and the routes.
Validate the content: no errors and no warnings.
Compare every public page with the old site.
Re-model the content for the editor, and compare again.
Deploy somewhere that can’t publish to the live site, try the editor, then switch.
Running the script
The script ships inside the package. Copy it into the site, set the choices in the table at its top, and run it from the site’s root:
cp .claude/skills/caracms-tina/tina-to-caracms.mjs scripts/node scripts/tina-to-caracms.mjs --from ../my-site-main --scaffold-configFlag | What it does |
|---|---|
--from | The built checkout of the Tina site. |
--scaffold-config | Also writes a starting caracms.config.ts from Tina’s schema, with Tina’s labels and help. Use it once; after that the config is yours. |
--fetch-images | Fetches images kept on other sites into the site’s media. |
--recipients | Sends every form’s email to one address, so tests never reach a client. |
Each run deletes the content folder and writes it again, so the same input always gives the same files. Re-run it as often as you like while you’re getting the conversion right.
Stop running the script once you’ve changed the content yourself, in the editor or by hand. A re-run would write over your changes. From then on the content is the site’s.
Beside the content, the script keeps one file: a map from each image’s old address to its new key and size. Commit it.
Rewriting the components
Each block keeps its markup and classes, and draws its fields through CaraCMS’s components. What Tina needed goes: its field markers, its visual-editing code, and its client queries. Building a site shows what a block looks like.
One catch-all route replaces the site’s route files. A collection such as a blog, whose posts live under a page, is held by that page in CaraCMS, so the posts follow the page if it moves.
Done
- Validate reports no errors and no warnings.
- The site builds and its remaining tests pass.
- Every public page matches the old site on a desktop and a phone width.
- Every heading, paragraph, caption and button that Tina could edit can be typed on the page.
- The audit is quiet, or each line it prints is one you’ve accepted.
For your agent
The caracms-tina skill, copied into the site by init, is the full method. Beside it are the conversion script, whose header is its manual, and a table of how every kind of Tina field converts. What becomes what is the short version.
llms.txt · llms-full.txt: this site for AI tools