Import/Export Deprecation FAQs

Prismic is preparing to deprecate the Import/Export tool and replace it with the new Migration API.

What does the deprecation of Import/Export mean for you?

Concretely, it means Import/Export will no longer be available for your repository as of April 30, 2024.

We urge you to try out the Migration API now, so you get a feel for what it can do for your workflow and prepare to transition to it for all of your content exporting and uploading use-cases.

We appreciate that the transition to a new tool can be time-consuming and requires development resources, but we are convinced that the transition will save you time in the long run.

Are documents created via the Migration API directly published?

No. When you upload documents via the Migration API, they will be added to a migration release. Your team can preview and bulk publish up to 1000 documents with one click.

How will export work with the Migration API?

Prismic has always allowed exports via the Document API. To export content, you can query it from the API and save it as JSON:

import * as prismic from "@prismicio/client"
import fs from "fs/promises"

function init() {
  const client = prismic.createClient("example-repo-name")
  const response = await client.dangerouslyGetAll()
  await fs.writeFile('response.json', JSON.stringify(response));
  console.log("Export complete")
}

init()

The current Import/Export tool uses a different format, which is not compatible with the Document API. Content queried from the Document API cannot be uploaded to the Import tool.

The new Migration API ingests content in the format output by the Document API, meaning that you can upload content that you have queried from the API. This streamlines the process of bulk content management, allowing you to query content, perform mutations, and upload it all with a simple script. See the example in the documentation.

To learn more, check out our Migration API TryOut guide.

Will the Migration API support all my import needs?

Yes, the API can do everything Import/Export could, including support for integration fields, legacy slices, and localized content.

What are the differences between Import/Export and the Migration API

There are two main differences:

  1. Data format:

    The json format of the Migration API was built to mimic the format of our Document API, thus making it easy to retrieve existing content.

    We know that some clients have built translation workflows based on the existing Import/Export data format. If this is the case for you, you may need to adjust your workflow.

  2. Handling of images and media files

    The method used by the Import/Export tool to retrieve, upload and attach your image to a document was often a source of failure or errors, especially with large media files.

    With the introduction of the Migration API, we also released an Asset API, which you can use to manage image files. For document creation, or to add a new image to an existing document, you will need to first create any media files that do not yet exist in your repository, and then use the ID of these files to add them to the your document. These steps can be connected with the help of some scripts.

Is the Migration API available for all plans?

Unlike Import/Export, the Migration API is available for all plans, but we will introduce limitations on usage per plan later this year.

Example scripts for Migration API
We have put together an example script to help ease the transition to Migration API.
GitHub - prismicio-community/migration-api-example-scripts

On the basis of an example of migrating HTML content of a 2 language website into a new Prismic repo, it demonstrates the following steps:

  • Extracting and uploading of media to the Asset API, either via URL or via files
  • Inserting media ids into your document content
  • POSTing documents
  • Creating localized translations of original language documents
  • Updating content to resolve links between documents

Availability of Migration API keys
You will need a key to access the Migration API. Keys are available in all repositories via the Try Migration API button on the Migration Release menu item.