---
title: "Migrating from Astro"
description: "Import an existing Astro project in one command."
url: "https://www.andromedacms.dev/docs/migrating-from-astro"
updated_at: 2026-09-24
---

# Migrating from Astro

```bash
bin/rails generate andromeda:import_astro ../my-astro-site
```

The generator:

1. copies `src/content` into `app/content/` and `src/assets` into `app/assets/`
2. rewrites frontmatter keys to `snake_case`, leaving the body byte-identical
3. rewrites MDX imports to partial paths (`content_components/callout`)
4. converts `content.config.ts` into entry classes
5. generates a stub partial for every component the content imports
6. prints what still needs a human

`--dry-run` prints the same report without writing anything.

## What carries over

| From Astro | Here |
|------------|------|
| `.md` / `.mdx` bodies | unchanged |
| Entry ids, and therefore URLs | same rules as `glob()` |
| Heading ids | same (github-slugger) |
| `headings` from `render()` | `entry.headings`, same shape |
| Zod schemas | converted to `attribute` lines |
| `image()` and `reference()` | the `:image` and `:reference` types |

## What needs your hands

- **Components.** A `.astro`, React or Vue component becomes a Rails partial.
  The generator writes the stub and lists what to fill in.
- **remark/rehype plugins.** Not supported; content that depends on one needs
  an equivalent, or an edit.
- **Pages and layouts.** Routing is Rails routing.

Astro's own [`examples/blog`](https://github.com/withastro/astro/tree/main/examples/blog)
imports and renders unchanged — that is a test in the gem's suite, not an
aspiration.
