apiVersion: couchtuner.io/v1 kind: MigrationPlan metadata: name: sales-db-to-cbcloud spec: source: type: couchdb endpoint: https://couchdb-prod.example.com auth: username: admin passwordFrom: vault://couchdb/creds#password database: sales-db target: type: couchbase-cloud endpoint: https://eu-west-2.couchbase.cloud auth: apiKeyFrom: vault://couchbase/api#key bucket: sales capacityRU: 5000 replication: mode: incremental batchSize: 5000 maxParallelism: 12 transformation: language: javascript script: | function transform(doc) // Add tenant prefix doc._id = "tenantA::" + doc._id; // Remove deprecated fields delete doc.oldField; return doc;
CouchTuner originally launched in 2011 as a content aggregator, providing links to third-party streaming servers like Putlocker. Because it indexed copyrighted material without authorization, it quickly became a target for the Digital Millennium Copyright Act (DMCA) and major film studios. migration couchtuner
| Pitfall | Symptoms | Mitigation | |---|---|---| | | Sudden spike in replication lag, back‑pressure throttling. | Run a pre‑migration network benchmark ( couchtuner nettest ) and provision a dedicated VPN or Direct Connect link. | | Document conflicts during final sync | Duplicate _id s, “conflict” errors from target SDK. | Choose a deterministic conflict‑resolution policy (e.g., “source wins” or timestamp‑based) in the plan. | | Missing attachments | Attachments not transferred, causing broken links. | Enable attachments: true in source adapter; verify that target bucket has blob support enabled. | | Schema drift | New fields appear in source after the dry‑run, causing verification failures. | Use “watch‑mode” transformation that adds a schema_version field; update the plan before cut‑over. | | Insufficient target capacity | Target throttles bulk writes, leading to prolonged migration windows. | Use CouchTuner’s capacity estimator ( couchtuner estimate ) and allocate a 20 % buffer. | apiVersion: couchtuner
Below is a minimal migration plan that moves a CouchDB production database ( sales-db ) to Couchbase Cloud (region eu‑west‑2 ). The plan includes a JavaScript transformation that prefixes every document’s _id with the tenant identifier. | Run a pre‑migration network benchmark ( couchtuner