couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "How_to_deploy_view_changes_in_a_live_environment" by NilsBreunese
Date Wed, 07 Dec 2011 12:19:15 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "How_to_deploy_view_changes_in_a_live_environment" page has been changed by NilsBreunese:

Cleaned up the instructions, integrated the rollback step and added a note about view cleanup.

  http://localhost:5984/database/_design/ddoc needs to be updated
  So the simple approach is:
+  1. Upload the old design doc to _design/ddoc-old (or copy _design/ddoc to _design/ddoc-old)
if you want an easy way to rollback in case of problems. This will cause the view indexes
for _design/ddoc to be shared with _design/ddoc-old.
-  1. Upload the updated design doc to _design/ddoc-new
+  2. Upload the updated design doc to _design/ddoc-new.
+  3. Query a view in _design/ddoc-new to trigger view index generation. You can track the
indexing progress via Futon at http://localhost:5984/_utils/status.html or by requesting http://localhost:5984/_active_tasks
+  4. Reupload the updated design doc to _design/ddoc (or copy _design/ddoc-new to _design/ddoc)
when view index generation is complete. This will cause the indexes built for _design/ddoc-new
to be shared with _design/ddoc. The updated design doc is now live with view indexes ready
to go!
+  5. Delete _design/ddoc-new and/or _design/ddoc-old at your discretion. Don't forget to
also run a clean-up to reclaim the disk space used by their view indexes:
-  2. Query a view in _design/ddoc-new to trigger view index generation
-  3. When view index generation is complete - copy _design/ddoc-new to _design/ddoc. This
will cause the already built indexes to be shared by both design documents.
-  4. Delete _design/ddoc-new at your discretion (or keep it in place for the next release)
- If you copy _design/ddoc to _design/ddoc-old before copying _design/ddoc-new to _design/ddoc
you can also easily roll back to the previous design document in case the update causes any
  To copy a document use:
   curl -X COPY <URL of source design document> -H "Destination: <ID of destination
design document>"
@@ -27, +26 @@

  When copying a document to an already existing destination, you'll also need to supply the
revision of the document you want to overwrite:
   curl -X COPY <URL of source design document> -H "Destination: <ID of destination
design document>?rev=<revision>"
- To copy http://localhost:5984/database/_design/ddoc-new to http://localhost:5984/database/_design/ddoc:
+ Example: copy http://localhost:5984/database/_design/ddoc to http://localhost:5984/database/_design/ddoc-old:
-  curl -X COPY http://localhost:5984/database/_design/ddoc-new -H "Destination: _design/ddoc"
+  curl -X COPY http://localhost:5984/database/_design/ddoc -H "Destination: _design/ddoc-old"
  '''Note: This approach will work for normal couch views, couchdb-lucene views (fulltext),
and should also work for bigcouch clusters - to my understanding'''

View raw message