Skip to content

No remote-to-local parity: export-seed is local-only and wrangler d1 export --remote is blocked by FTS5 #2055

Description

@DavidPivert

Summary

There's no first-class way to make a local dev database ISO to a remote (production) instance, which is needed to test rendering/theme work against real content. The two building blocks that should combine for this each fall short:

  1. emdash export-seed is local-only. It reads a local DB file (-d, --database), so it can dump a local DB → seed, but it can't pull from a remote instance. There's a login command (for content/schema HTTP APIs) but export-seed doesn't accept a --url/remote target.

  2. wrangler d1 export --remote is blocked by EmDash's FTS5 tables. On Cloudflare D1 it errors:

    D1 Export error: cannot export databases with Virtual Tables (fts5)
    

    because EmDash creates _emdash_fts_* virtual tables for full-text search. The obvious "dump prod D1 to a file" path is dead on arrival.

Workaround (works, but manual and non-obvious)

wrangler d1 export --remote supports --table, so you can export every table except the FTS5 ones and reload locally:

# list tables minus _emdash_fts_*, pass each as --table, then:
wrangler d1 export <db> --remote --output prod.sql --table <t1> --table <t2> ...
wrangler d1 execute <db> --local --file prod.sql   # (INSERT OR REPLACE to avoid PK clashes with a bootstrapped local DB)

FTS rebuilds locally afterward. This works, but you have to enumerate ~all tables by hand and know to exclude the virtual ones.

Request

Either (or both):

  • export-seed --remote / --url — let export-seed pull schema + content from a logged-in remote instance (it already has login), producing a seed the local DB can apply. This sidesteps the D1/FTS5 limitation entirely since it goes through the app, not a raw D1 dump.
  • Docs — document the --table-excluding-FTS5 recipe for wrangler d1 export --remote, since the naive command fails with a confusing error.

Environment

  • emdash 0.29.x, Cloudflare D1 backend, wrangler 4.103.
  • FTS5 tables created by EmDash: _emdash_fts_<collection> (+ _data/_idx/_docsize/_config).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions