Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude loads one when your task matches it, or you run it by name.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Battle-tested tools for migrating SurrealDB from v2.x to v3.x. Built after discovering that the official surreal export/import roundtrip fails on real-world databases with backslash escaping, compound record IDs, and multi-line INSERT statements.
Tested on a production database: 119,962 records migrated with zero failures.
scripts/surrealdb-migrate.ts - Custom SurQL parser + CBOR-over-WebSocket importer with checkpoint/resumescripts/surrealdb-restore-sdk.ts - SDK-based restore that fixes v2's backslash escaping bugscripts/rid-to-surql.ts - RecordId-to-SurrealQL serializer (fixes SDK v2's broken toString() for compound IDs)docs/breaking-changes.md - Complete v2-to-v3 breaking changes referencedocs/playbook.md - Step-by-step production migration playbookdocs/benchmarks.md - Real-world migration benchmarks and impact assessmentgit clone https://github.com/necmttn/surrealdb-v2-to-v3.git
cd surrealdb-v2-to-v3
bun install
curl -X GET http://localhost:8000/export \
-H "NS: your_ns" -H "DB: your_db" \
-H "Authorization: Basic $(echo -n 'root:root' | base64)" \
-o backup.surql
# Full migration with v3 schema transformations
bun run scripts/surrealdb-migrate.ts backup.surql \
--url http://localhost:8000 \
--user root --pass root \
--ns your_ns --db your_db \
--v3
# Dry run first to assess
bun run scripts/surrealdb-migrate.ts backup.surql --dry-run
| Flag | Default | Description |
|---|---|---|
--url | http://localhost:8000 | SurrealDB URL |
--user | root | Username |
--pass | root | Password |
--ns | prod | Namespace |
--db | prod | Database |
--batch | 50 | Records per insert batch |
--v3 | off | Apply v3 schema transformations |
--data-only | off | Skip schema, only import INSERT data |
--dry-run | off | Parse and report without importing |
surreal import?The official surreal export + surreal import roundtrip breaks on:
\boldsymbol, file paths). v3's parser rejects them.block:[document:xxx, '/path'] aren't supported by the text importer.This toolkit solves all of these by parsing the SurQL export into JS objects and using the SDK's CBOR binary protocol over WebSocket.
See Troubled Migrations for detailed examples with real data patterns showing exactly how each failure manifests and how the custom tools handle them.
This repo includes a Claude Code skill for AI-assisted migration.
# From your project directory
claude plugin install github://necmttn/surrealdb-v2-to-v3
/surrealdb-migrate ./path/to/schema/or/backup
The skill provides:
Handles the full SurQL export format including:
block:[document:xxx, '/path'])table:⟨uuid⟩)d'...') and UUID (u'...') literalsCrash recovery built-in. If migration fails mid-way, re-run the same command to resume from the last checkpoint.
Handles WebSocket disconnections with up to 3 retries and exponential backoff.
When a batch insert fails, automatically falls back to inserting records one-by-one to maximize data recovery.
The --v3 flag automatically transforms function names and syntax in schema statements during import.
MIT
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Generated from the plugin's indexed repository (necmttn/surrealdb-v2-to-v3) — no native marketplace selected
npx claudepluginhub p/necmttn-surrealdb-v2-to-v3Plugins from other owners that cover similar ground