Metabase Serdes Export/Import Workflow

VerifiedCaution

Export Metabase content as YAML, validate with checkers, edit, and import back. Covers the full serdes round-trip workflow.

Sby Skills Guide Bot
DevelopmentAdvanced
8/29/2026
Claude CodeCursorCodex
#metabase#serdes#yaml#export-import#validation

Recommended for

Automated summary

Describes the full Metabase serdes round trip: exporting content as YAML, validating it with checkers, editing the files, and importing them back into the target Postgres database.

Strengths

  • Gives the ordered sequence export → baseline validation → edit → re-validate → import → browser verification
  • Documents both checkers (structural via Malli schemas, cards via Lib) with their flags (--lenient, --manifest, --output)
  • Explicitly warns about the missing MB_DB_CONNECTION_URI pitfall that silently routes import to H2
  • Lists the useful export flags: collection filtering (-c), field values (-f), continue on error (-e)

Limitations

  • Assumes access to enterprise code through the :ee alias, which a stock Metabase repo does not have
  • The dev instance's Postgres connection string must be found manually (nREPL or startup output)
  • Does not cover YAML editing rules, which are delegated to the serdes-yaml-edit skill
When to use it

Use it when you need a complete Metabase content round trip (export, fix, re-import) in a development environment.

When not to use it

Avoid it when no enterprise Metabase instance is running or the target Postgres URI is unknown, or for a simple dashboard tweak that does not need serdes.

Security analysis

Caution
Quality score85/100

No obfuscated payloads, curl|sh, destructive filesystem commands, or secret exfiltration. The commands are legitimate Metabase serdes CLI invocations. However, the import operation mutates a live production-style Postgres database and relies on credentials, so it carries meaningful execution risk if run blindly, warranting caution rather than 'safe'.

Findings
  • •Import step writes to a live Metabase Postgres database (MB_DB_CONNECTION_URI) and can overwrite/modify content with -e continuing on error
  • •Instructs the agent to harvest the DB connection string from nREPL/startup output, which could expose credentials in logs
How this analysis is made

Examples

Full round trip
Export the serdes content of my running Metabase dev instance to /tmp/metabase-export, run both checkers to get a baseline, then import it back and tell me what failed.
Scoped export and validate
Export only collections 12 and 34 to /tmp/export-subset with the :ee alias, then run the structural and cards checkers on that directory.
Validate cards against metadata
Run the cards checker in lenient mode on /tmp/metabase-export, write the manifest and the detailed results to file, and summarize any unresolved queries.

name: serdes-workflow description: Export content from a running Metabase instance, validate with checkers, edit YAML, and import back. Use when the user wants to export, import, or run the full serdes round-trip workflow.

Serdes Workflow Skill

End-to-end workflow for exporting Metabase content as YAML, validating it, editing it, and importing it back.

Prerequisites

All commands require the :ee alias since export, import, and checkers live in enterprise code.

You need MB_DB_CONNECTION_URI set to point at the target Metabase Postgres database when importing. The running dev instance's connection string is in the worktree environment (check the nREPL or startup output).

Export

clojure -M:run:ee export /path/to/export-dir

Flags:

  • -c 123,456 - export only specific collection IDs
  • -f - include field values
  • -e - continue on error

This writes YAML files in the serdes directory layout:

databases/<db-name>/<db-name>.yaml
databases/<db-name>/schemas/<schema>/tables/<table>/<table>.yaml
databases/<db-name>/schemas/<schema>/tables/<table>/fields/<field>.yaml
collections/<eid>_<slug>/cards/<eid>_<slug>.yaml

Validate

Always run both checkers after any modification. They skip full Metabase startup (~8s each).

Structural checker (fast, schema-based)

clojure -M:run:ee --mode checker --checker structural --export /path/to/export-dir

Validates YAML shapes against Malli schemas. Catches typos, missing required fields, wrong types.

Cards checker (query validation)

clojure -M:run:ee --mode checker --checker cards --export /path/to/export-dir

Validates that card queries resolve correctly against exported metadata (tables, fields, FKs). Uses Lib under the hood.

Additional cards checker flags:

  • --lenient - fabricate metadata on demand (when no database schema files exist)
  • --manifest /path/to/manifest.yaml - write manifest of all referenced entities (lenient mode only)
  • --output /path/to/results.edn - write detailed results to file

Edit YAML

See the serdes-yaml-edit skill for guidance on editing YAML files. The critical rule: run both checkers after every edit before proceeding.

Import

MB_DB_CONNECTION_URI="postgres://user:pass@localhost:5432/metabase_dbname" \
  clojure -M:run:ee import /path/to/export-dir -e

The -e flag continues on error. The MB_DB_CONNECTION_URI must point at the same Postgres database the running Metabase instance uses - without it, import defaults to H2 which is wrong.

Full Demo Sequence

  1. Export: clojure -M:run:ee export /tmp/metabase-export
  2. Validate baseline: run both checkers
  3. Edit YAML files (see serdes-yaml-edit skill)
  4. Re-validate: run both checkers again
  5. Import: MB_DB_CONNECTION_URI=... clojure -M:run:ee import /tmp/metabase-export -e
  6. Verify in browser

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/metabase-serdes-export-import-workflow-mte1lg28/download' --output '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md.part' && mv '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md.part' '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: Prerequisites

All commands require the :ee alias since export, import, and checkers live in enterprise code.

You need MB_DB_CONNECTION_URI set to point at the target Metabase Postgres database when importing. The running dev instance's connection string is in the worktree environment (check the nREPL or startup output).

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md' && test -s '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/serdes-workflow' && cp -R '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28' '.claude/skills/serdes-workflow'

Cursor
test -f '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md' && test -s '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/serdes-workflow' && cp -R '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28' '.cursor/skills/serdes-workflow'

Codex
test -f '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md' && test -s '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/serdes-workflow' && cp -R '.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28' '.agents/skills/serdes-workflow'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/metabase-serdes-export-import-workflow-mte1lg28'

openskills read 'metabase-serdes-export-import-workflow-mte1lg28'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/metabase-serdes-export-import-workflow-mte1lg28/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills