Import & Export

Bulk-load and extract records with CSV/Excel handlers. This guide follows version 3.1.7 (03acdf712c).

For field definitions, see Properties, Tags & Segments.

Module layout

backend/core-api/src/modules/import-export/:

  • graphql/schema/{import,export,common}.ts, resolvers, db/models/{Imports,Exports}.ts, trpc/{import,export,templates,index}.ts, workers/, utils/, routes.ts.
  • Shared worker interface: backend/erxes-api-shared/src/core-modules/import-export/ (index.ts, worker.ts).

Each run stores contentType, config, status, and history. Per-entity column handling lives in each module's meta/import-export/ directory, so contacts, products, and plugin entities can define their own headers and validators.

Running a job

  1. Download the template for the target content type (trpc/templates or the UI export dialog).
  2. Fill required columns (for products, code and categoryId; for contacts, the configured search fields) and keep custom-field codes exact.
  3. Start the import, then poll the Imports record for status and history errors.
  4. For exports, use getExportHeaders/getExportData handlers or the UI action, then download from the generated file link.

Large jobs run through the import-export worker started via startImportExportWorker({ pluginName, config, app }) in each service's meta. Do not edit the stored file mid-run.

Verify

  1. Import a 5-row sample and confirm all rows and error rows are reported.
  2. Export the same filter and diff the round-tripped columns.
  3. Confirm tenant isolation: imports in one subdomain never affect another.

Source references

Was this helpful?