Couchmigrate is a command-line tool for migrating CouchDB design documents with zero downtime. Version 1.0.1 is the stable release. It compares the new design document against the existing one, and only migrates if there is a difference. The migration process copies the old document to _OLD, imports the new one as _NEW, triggers the view to build, polls until done, then renames _NEW to the original ID and deletes _OLD. Supports JSON files and JavaScript modules, and works with CouchDB and IBM Cloudant, including IAM authentication via environment variables.
npm install couchmigrateNo compatibility data collected yet for this library.
Run couchmigrate with a JSON design document file and target database.
Use .json for JSON files or .js for JavaScript modules.
Set COUCH_URL and IAM_API_KEY (if using IAM) before running.
Ensure no other process is modifying the design document during migration.
Run `npm install -g couchmigrate` (installs nano as a dependency) or `npm install nano` in the project.
Set the environment variable before running: export COUCH_URL=http://username:password@host:port or set it in your shell.
Ensure the design document JSON includes _id and views fields correctly.
Provide the correct path to the design document file.