Strapi
Published in

Strapi

Migrating Content Between Environments Using Import Export Entries Plugin

Learn how to migrate data from one environment to another using the Import Export Entries plugin.

What is Import Export Entries Plugin

Prerequisites

  • The Import-Export Entries plugin must be installed on both the source and destination environments.
  • Both the source and destination environments must have the same content types and fields.
  • Both the source and destination environments must be running the same version of Strapi.

Installing the Import-Export Entries Plugin

npm install strapi-plugin-import-export-entries
npm run build
npm run develop
Import Export Entries now available under your List of Plugins

Setting up the plugin and preparing for content migration

  1. Create a plugins.js file under the config folder and add the code below
module.exports = ({ env }) => ({
//...
'import-export-entries': {
enabled: true,
},
//...
});
  1. Create another file src/admin/webpack.config.js
'use strict';

const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');

module.exports = (config) => {
config.plugins.push(new MonacoWebpackPlugin());

return config;
};
  1. Then rebuild your admin dashboard using
npm run build --clean
  1. Now, Start the server to access your Dashboard by running
npm run develop
  1. Once you are in your Admin dashboard, You should see “Import Export” Under “Plugins”.
The Import Export Plugin is now accessible.

Exporting Content

  1. In the Strapi admin panel, go to the “Plugins” section and click on the “Import/Export” plugin.
  1. Select the “Export” tab and You will see a pop-up interface

Importing Content

  1. In the Strapi admin panel, go to the “Plugins” section and click on the “Import/Export” plugin.
  1. On the Import/Export plugin page, select the “Import” tab.
  1. In the “Import” tab, click on the “Choose File” button and select the JSON file that contains the content that you want to import.
  1. After selecting the JSON file, click on the “Import” button to start the import process.
  1. The import process will start and the imported content will be added to your Strapi project.
  2. You can verify that the imported content has been added by going to the “Content Types” section in the Strapi admin panel and checking the relevant content type

Troubleshooting common issues and best practices for successful content migration

  1. Exported content is not appearing in the import file:
  • This can happen if the plugin is not configured correctly. Make sure that you’ve selected the right export format and that all of the fields in your content type are included in the export.
  1. Imported content is not appearing in the destination environment
  • This can happen if the import file is not formatted correctly, or if there are errors in the content itself. Make sure that you’ve checked the format of your import file and that all of the required fields are included. If you’re still having trouble, try exporting your content from the source environment and importing it into a fresh install of the destination environment to see if there are any errors.
  1. Some content is missing after migration
  • This can happen if certain pieces of content (e.g., images) are not properly exported or imported. Make sure that all of your content types include all required fields, and that any binary data (e.g., images) is properly included in both the export and import files.

Conclusion

--

--

Strapi is the leading open-source headless CMS. It’s 100% Javascript, fully customizable and developer-first. Unleash your content with Strapi.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store