Cortex supports full instance migration through its library import/export feature. Export your entire knowledge base — documents, entities, relationships, communities, embeddings, and all graph data — as a portable ZIP archive, then import it into another instance without re-running the expensive knowledge graph generation pipeline.
Overview
The import/export feature is accessible from Settings > Data Management and via the Admin API. It handles:
- All document files (PDFs, markdown, DOCX, etc.)
- Chunk data with vector embeddings
- Entity nodes with embeddings and metadata
- All entity-to-entity relationships (both per-chunk and cross-document)
- Communities and their memberships
- Collections and document assignments
- Merge history (deduplication audit trail)
- System metadata (staleness timestamps)
Exporting
Via the Web Interface
- Navigate to Settings > Data Management
- Review the stats summary showing your document, entity, and relationship counts
- Click Export Library
- Wait for the progress bar to complete
- Click Download Export to save the ZIP file
Via the API
Code
Response:
Code
Code
Code
Importing
Import Modes
| Mode | Behavior | When to Use |
|---|---|---|
| Clean (default) | Requires the target instance to be completely empty. Returns an error if any data exists. | Fresh instance setup, migration to a new server |
| Replace | Automatically deletes all existing data before importing. Requires typing "DELETE" to confirm. | Restoring a backup, overwriting test data |
Via the Web Interface
- Navigate to Settings > Data Management
- Select your import mode (Clean import or Replace all)
- Drag and drop or browse for your export ZIP file
- For Replace mode: type
DELETEin the confirmation field - Click Import Library (or Replace & Import)
- Monitor the progress bar — first for the archive upload, then as data is restored
- Review the result summary showing imported counts and any warnings
The web UI uploads the archive in small chunks, so large exports work reliably even behind reverse proxies with short request timeouts (e.g. Traefik's 60s default body-read timeout on Coolify).
Via the API
Code
If a proxy between you and the backend cuts off long uploads, use the chunked
upload endpoints instead (/api/admin/import/upload/start, then sequential
PUT …/chunk?offset=N requests, then POST …/finish?mode=clean) — see the
API reference for details. The web UI always uses the chunked flow.
Response:
Code
Poll the task status to monitor progress:
Code
Export Archive Format
The export is a ZIP64 archive using NDJSON (newline-delimited JSON) for efficient streaming:
Code
The manifest.json contains metadata for validation:
Code
Embedding Compatibility
The export includes all vector embeddings to avoid costly recomputation. On import, the system checks the manifest against the target instance's embedding configuration:
- Compatible (same model and dimension): Embeddings are imported as-is. Vector search works immediately.
- Incompatible (different model or dimension): The import still proceeds, but returns a warning. Vector search results may be degraded until documents are reprocessed to regenerate embeddings.
Important Notes
- Concurrency: Only one export or import can run at a time. Concurrent requests return HTTP 409.
- API keys excluded: API keys are instance-specific and are not included in the export.
- File path remapping: Document file paths are automatically remapped to the target instance's upload directory.
- No merge mode: Importing into an instance with existing data requires either resetting first (clean mode) or using replace mode. Merging two knowledge graphs is not supported.
- Background tasks: Both export and import run as background tasks with progress tracking via the standard
/api/tasks/{task_id}endpoint.