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:
-
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.
-
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.