Export & Import
Genie’s export/import system produces schema-versioned JSON documents for full backups, selective snapshots, and cross-instance migration. Data is organized into 9 groups that can be exported individually or all at once.At a Glance
Data Groups
Every export targets one or more groups. Each group maps to a set of database tables:| Group | Tables | Description |
|---|---|---|
boards | boards, board_templates, task_types | Kanban boards, column configs, templates |
tasks | tasks, task_tags, task_actors, task_dependencies, task_stage_log | Tasks with relationships and audit trail |
tags | tags | Tag definitions (excludes test tags) |
projects | projects | Project records |
schedules | schedules | Cron schedules with run_spec |
agents | agents, agent_templates, agent_checkpoints | Agent configs, templates, state checkpoints |
apps | app_store, installed_apps, app_versions | App registry (graceful skip if missing) |
comms | conversations, conversation_members, messages, mailbox, team_chat, notification_preferences | All messaging data |
config | os_config, instances, warm_pool, golden_images | Infrastructure config (graceful skip if missing) |
Groups that reference optional tables (apps, config) will gracefully skip any tables not present in your database schema.
Export Format
Every export produces a JSON document with this structure:| Field | Description |
|---|---|
version | Schema version (currently 1.0). Import validates this before proceeding |
exportedAt | ISO 8601 timestamp |
exportedBy | Actor name (agent or user) |
genieVersion | Genie CLI version that produced the export |
type | full for export all, partial for single-group exports |
groups | Which data groups are included |
skippedTables | Tables that were requested but not found in the database |
data | Table name → array of row objects |
Export Commands
genie export all
Full backup of all 9 data groups. Automatically generates an output filename if --output is not specified.
Terminal
genie-backup-YYYYMMDD.json.
genie export boards
Export boards, board templates, and custom task types. Optionally filter by board name.
Terminal
Custom task types (
is_builtin = false) are included. Built-in types are excluded since they’re recreated on install.genie export tasks
Export tasks with tags, actors, dependencies, and stage log. Optionally filter by project.
| Flag | Description |
|---|---|
--project <name> | Only export tasks belonging to this project |
Terminal
genie export tags
Export tag definitions. Test tags (prefixed with test-) are excluded.
Terminal
genie export projects
Export project records.
genie export schedules
Export cron schedules with their run_spec configuration. Optionally filter by schedule name.
Terminal
genie export agents
Export agent configurations, templates, and state checkpoints.
genie export apps
Export the app store registry. Gracefully skips if app tables don’t exist.
genie export comms
Export all communication data: conversations, messages, mailbox, team chat, and notification preferences.
genie export config
Export infrastructure configuration. Gracefully skips if config tables don’t exist.
Shared Export Options
All export commands accept:| Flag | Description |
|---|---|
--output <file> | Write to file instead of stdout. Parent directories are created automatically |
--pretty | Pretty-print JSON with 2-space indentation |
Import Command
genie import
Import data from a JSON export file. Validates schema version, resolves FK dependencies automatically, and runs the entire import in a single transaction.
| Flag | Description |
|---|---|
--fail | Abort on any conflict (default) |
--merge | Skip existing rows, import only new ones |
--overwrite | Replace existing rows with imported data |
--groups <list> | Comma-separated groups to import (e.g., boards,tags) |
Conflict Modes
--fail (default)
--fail (default)
Checks all tables for conflicting primary keys before inserting anything. If any row already exists, the entire import is aborted with an error message showing which rows conflict.
Terminal
--merge
--merge
Uses
INSERT ... ON CONFLICT DO NOTHING — existing rows are untouched, only new rows are added. Safe for incremental imports where you want to preserve local changes.Terminal
--overwrite
--overwrite
Deletes the conflicting row first, then inserts the imported version. Use this to force-sync from a known-good export.
Terminal
Selective Import
Use--groups to import only specific data groups from a full backup:
Terminal
FK Dependency Resolution
Import automatically sorts tables into 4 dependency levels to satisfy foreign key constraints:| Level | Tables |
|---|---|
| 0 | schedules, projects, agent_templates, tags, task_types, … |
| 1 | boards, board_templates, agents, conversations, … |
| 2 | tasks, messages, mailbox, team_chat, … |
| 3 | task_tags, task_actors, task_dependencies, task_stage_log, … |
tasks.parent_id, messages.reply_to_id, conversations.parent_message_id) are handled with a two-pass insert: rows are inserted with NULL self-references first, then updated after all rows exist.
Audit Trail
Every successful import is recorded as an audit event with:- Conflict mode used
- Per-table row counts
- Skipped tables
- Source export version and date