Strapi Import/Export Entries Plugin
This is a Strapi v4 plugin designed for seamless import and export of data entries within a Strapi application. It provides functionalities directly integrated into the Strapi Content Manager UI, allowing users to import and export content types, single types, components, dynamic zones, and media files with just a few clicks. The plugin currently operates at version 1.23.1 and demonstrates an active release cycle, with frequent updates addressing new features and bug fixes, supporting Node.js versions from 14.19.1 up to 20.x.x and requiring Strapi 4.10.5 or newer. A key differentiator is its robust access control mechanism, which allows administrators to define which user roles can perform import and export operations. It also supports filtering and sorting during export, offers a JSON v2 format for data exchange, and provides options to export plugin-specific content types, making it a comprehensive tool for data migration and backup within the Strapi ecosystem. The plugin also provides programmatic access through its services and a Content API for more advanced use cases, alongside webhook support for automated workflows.
Common errors
-
Plugin 'import-export-entries' not found or 'Cannot read properties of undefined (reading 'service')' when accessing plugin service.
cause The plugin is not correctly enabled in `config/plugins.js` or the admin panel has not been rebuilt after installation.fixVerify that `config/plugins.js` contains the correct entry with `enabled: true`. Then, run `npm run build --clean` or `yarn build --clean` to rebuild the admin panel. -
Error: Node.js version X.Y.Z is not supported. Please use a compatible Node.js version.
cause Your current Node.js version is outside the range required by the plugin's `engines` field.fixInstall a compatible Node.js version (e.g., `>=14.19.1 <=20.x.x`) using a tool like `nvm` or by updating your Node.js installation. -
Import failed: Invalid JSON v2 format. Please ensure your file conforms to the specification.
cause The JSON file being imported does not follow the expected structure or contains malformed data according to the plugin's JSON v2 specification.fixReview the plugin's documentation for the JSON v2 import format and adjust your import file to match the required schema, paying close attention to object structures and data types.
Warnings
- breaking This plugin is designed exclusively for Strapi v4. Attempting to use it with Strapi v3 or earlier versions will lead to incompatibility issues.
- gotcha After installing or updating the plugin, it is often necessary to rebuild the Strapi admin panel to ensure the UI components are correctly integrated and visible. Failure to do so can result in missing plugin sections or broken interfaces.
- gotcha The plugin has specific Node.js version requirements (currently `>=14.19.1 <=20.x.x`). Using an unsupported Node.js version may lead to installation failures or runtime errors.
- deprecated The JSON v1 import format is deprecated. While it may still work in some cases, it is recommended to use the newer JSON v2 format for all import operations.
Install
-
npm install strapi-plugin-import-export-entries -
yarn add strapi-plugin-import-export-entries -
pnpm add strapi-plugin-import-export-entries
Imports
- Plugin Configuration
module.exports = ({ env }) => ({ 'importExportEntries': { enabled: true }, // Incorrect key });module.exports = ({ env }) => ({ 'import-export-entries': { enabled: true, config: { /* ... */ }, }, }); - Plugin Service Access
import { importEntries } from 'strapi-plugin-import-export-entries'; // Direct module import usually doesn't work for Strapi plugin servicesconst { importEntries, exportEntries } = strapi.plugin('import-export-entries').service('main'); // Or for a specific service: // const myCustomService = strapi.plugin('import-export-entries').service('myCustomLogic');
Quickstart
// 1. Install the plugin using npm or yarn:
// npm i strapi-plugin-import-export-entries
// or
// yarn add strapi-plugin-import-export-entries
// 2. Enable and configure the plugin in your Strapi project's `config/plugins.js` file:
module.exports = ({ env }) => ({
// ... other plugins ...
'import-export-entries': {
enabled: true,
config: {
// Optional: Configure a unique 'idField' per collection type to prevent ID conflicts during import.
// For example, if you have a 'product' collection with a unique 'sku' field:
// idField: {
// product: 'sku',
// },
// Other configurations like 'import.tempFolderPath' can be added here.
},
},
// ...
});
// 3. Rebuild your Strapi admin panel to apply the plugin changes:
// npm run build --clean
// or
// yarn build --clean