mido
v1.0.7
Published
## Introduction
Readme
Mido CLI
Introduction
mido is a simple CLI tool for migration and seeding of Cloudflare Durable Objects across zones or accounts. It helps with transferring data from source to target Durable Objects and for seeding new data.
Installation
Install mido globally with npm:
npm install mido -gConfiguration
Set up your source and target Workers with /dump and /write endpoints for migration:
- Source Worker: Implements
/dumpfor data retrieval. - Target Worker: Offers
/writefor writing data.
See examples in the /workers directory for source and target workers.
Usage
Migrating Durable Objects
Migrate data using:
mido migrate --source [SOURCE_URL] --dest [DEST_URL] --batchSize [BATCH_SIZE] --input [INPUT_FILE]Options:
--source, -s: Source DO Worker dump endpoint URL.--dest, -d: Destination DO Worker write endpoint URL.--batchSize, -b: Records per batch (≤ 1000).--input, -i: JSON file with Durable Object IDs.
Seeding Durable Objects
Seed data with:
mido seed --doId [DO_ID] --target [TARGET_URL] --data [DATA_FILE] --batchSize [BATCH_SIZE]Options:
--doId, -id: Durable Object ID for seeding.--target, -t: Target DO endpoint URL.--data, -d: JSON file with seed data.--batchSize, -b: Batch size (max 1000).
Best Practices
- Secure
/dumpand/writeendpoints. - Test migration and seeding in staging before production.
