{"id":47329,"library":"couchmigrate","title":"couchmigrate","description":"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.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/glynnbird/couchmigrate","tags":["javascript","CouchDB","design document","migration","command-line"],"install":[{"cmd":"npm install couchmigrate","lang":"bash","label":"npm"},{"cmd":"yarn add couchmigrate","lang":"bash","label":"yarn"},{"cmd":"pnpm add couchmigrate","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"CouchDB client library used for database operations","package":"nano","optional":false}],"imports":[],"quickstart":{"code":"couchmigrate --dd dd.json --db mydatabase","lang":"javascript","description":"Run couchmigrate with a JSON design document file and target database."},"warnings":[{"fix":"Use .json for JSON files or .js for JavaScript modules.","message":"The design document file must have either .json or .js extension; otherwise, it will not be processed correctly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set COUCH_URL and IAM_API_KEY (if using IAM) before running.","message":"The tool relies on environment variables COUCH_URL and optionally IAM_API_KEY. If not set, it will fail with connection errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure no other process is modifying the design document during migration.","message":"The migration process creates temporary documents _OLD and _NEW, which may cause conflicts if other processes are modifying the same design document concurrently.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.1':18 'authent':89 'build':60 'cloudant':86 'command':6,99 'command-lin':5,98 'compar':24 'copi':44 'couchdb':11,83,94 'couchmigr':1,2 'delet':72 'design':12,27,95 'differ':40 'document':13,28,47,96 'done':63 'downtim':16 'environ':91 'exist':31 'file':76 'iam':88 'ibm':85 'id':70 'import':50 'includ':87 'javascript':78,93 'json':75 'line':7,100 'migrat':10,35,42,97 'modul':79 'new':26,52,55,66 'old':46,49,73 'one':32,53 'origin':69 'poll':61 'process':43 'releas':22 'renam':65 'stabl':21 'support':74 'tool':8 'trigger':56 'variabl':92 'version':17 'via':90 'view':58 'work':81 'zero':15","created_at":"2026-06-07T16:50:58.483644+00:00","updated_at":"2026-06-07T16:50:58.483644+00:00","problems":[{"fix":"Run `npm install -g couchmigrate` (installs nano as a dependency) or `npm install nano` in the project.","cause":"Missing dependency nano","error":"Error: Cannot find module 'nano'"},{"fix":"Set the environment variable before running: export COUCH_URL=http://username:password@host:port or set it in your shell.","cause":"Environment variable COUCH_URL is required","error":"Error: COUCH_URL not set"},{"fix":"Ensure the design document JSON includes _id and views fields correctly.","cause":"The JSON design document file might be malformed or missing the required structure","error":"Error: Cannot read properties of undefined (reading 'map')"},{"fix":"Provide the correct path to the design document file.","cause":"The specified file path does not exist","error":"Error: ENOENT: no such file or directory, open 'dd.json'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/glynnbird/couchmigrate#readme","github":"https://github.com/glynnbird/couchmigrate","docs":null,"changelog":null,"pypi":null,"npm":"couchmigrate","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}