---
title: "Migrate to Prismic"
description: "Learn how to migrate your existing content to Prismic with an AI agent."
category: "concepts"
audience: developers
tags: ["new"]
lastUpdated: "2026-10-01T21:55:58.000Z"
---

AI agents like [Claude Code](https://claude.com/product/claude-code), [Codex](https://openai.com/codex/), and [Cursor](https://cursor.com/) can migrate your content from a different CMS to Prismic. With the [Prismic CLI](https://prismic.io/docs/cli.md) and the [Prismic MCP server](https://prismic.io/docs/mcp.md), the agent:

* Exports your content from your current CMS.
* Creates Prismic content models that fit it.
* Imports your pages and assets into Prismic, ready for you to review and publish.

Migrating from WordPress? See the [WordPress migration guide](https://prismic.io/docs/from-wordpress.md).

> A migration is not a one-click solution. The agent stops for your review after each step, unless you tell it not to. Correct its work before it moves on.

# Set up your agent

1. **Install the Prismic skill**

   The Prismic [skill](https://agentskills.io/) teaches your agent to use the [Prismic CLI](https://prismic.io/docs/cli.md) and to read this documentation. Install it:

   ```sh
   npx skills add --global --yes prismicio/skills
   ```

2. **Connect to the MCP server**

   [Connect your agent to the Prismic MCP server](https://prismic.io/docs/mcp.md#connect-to-the-mcp-server). The agent uses it to import content and assets.

   > [Activate Prismic MCP](https://prismic.io/docs/mcp.md#activate-prismic-mcp) on your repository if it isn't on.

# Migrate your content

Start the migration with a prompt like this:

```md filename=Prompt
Migrate the blog from https://example.com to a new Next.js website with
Prismic. The site uses WordPress. Keep the existing URLs. Follow the
migration guide: npx prismic docs view migration
```

Run your agent in an existing or a new [Next.js](https://prismic.io/docs/nextjs.md), [Nuxt](https://prismic.io/docs/nuxt.md), or [SvelteKit](https://prismic.io/docs/sveltekit.md) project. The Prismic CLI runs only in these projects.

The agent migrates in three steps.

1. **Export**

   The agent first defines the scope with you: the website's URL, its CMS and how to access it, which pages to migrate, and the locales. You don't have to migrate everything. Then, it:

   * Exports the content with a script that calls the CMS's API, one JSON file per page. Without an API, it uses an export file you provide, and scrapes the website only as a last resort.
   * Maps each URL pattern in the sitemap to a type. Routes and internal links rely on this map.
   * Notes what the website shows but the CMS doesn't hold, such as the navigation, the footer, and SEO metadata.

2. **Model**

   Next, the agent creates [page types](https://prismic.io/docs/content-modeling.md#page-types), [custom types](https://prismic.io/docs/content-modeling.md#custom-types), and [slices](https://prismic.io/docs/slices.md) with the [Prismic CLI](https://prismic.io/docs/cli.md). These content models decide the quality of the migration, so review them in the [Type Builder](https://prismic.io/docs/type-builder.md) until they are right. It also:

   * Adds [routes](https://prismic.io/docs/routes.md) to `prismic.config.json` that match the old URLs.
   * Checks that every exported field has a place in the content models, and lists what it dropped.

3. **Import**

   Finally, the agent imports your content into [releases](https://prismic.io/docs/releases.md) with the Prismic MCP server, after telling you how many pages and assets to expect. Along the way, it:

   * Builds each page to match your content models.
   * Creates your website's structure and layout first, such as settings and navigation, then content that pages reference, such as authors, then pages. Each translation follows its primary-language page.
   * Reruns safely, without duplicating content or deleting pages.
   * Uploads each asset once and reuses it everywhere, including in rich text. Links to files such as PDFs become media links.
   * Turns internal links into page links in link fields, navigation, and rich text, in a second pass once every page exists.
   * Keeps rich text to the blocks each field allows, moves tables, videos, and embeds into slices, and logs content it can't map instead of dropping it.
   * Imports one or two pages of each type for you to check before the rest, then reports failures grouped by cause and retries only those.

   > A release holds up to 1,000 pages. The agent splits larger migrations across several releases.

   When the import is done, review the releases in Prismic and publish them.

# Migrate programmatically

The previous way to migrate is to write your own code with the [Migration API](https://prismic.io/docs/migration-api-technical-reference.md) and [`@prismicio/client`](https://prismic.io/docs/technical-reference/prismicio-client.md). It still works for existing migration scripts, but we recommend migrating with AI. See [Migrate to Prismic programmatically](https://prismic.io/docs/migration/programmatic.md).
