How to restore Couchbase Views to another Data bucket?

I was Struggling for restoring my couchbase views from one Data Bucket to another. This is useful when you are still in development phase and want to change Data or create new bucket from existing one. Easiest way to do is just copy a file name “master.couch.X” which is located inside the same directory as bucket name. Here is detail how can it be done

Let’s suppose you have bucket name “A”  and data directory is /var/lib/couchbase/data/ inside this there is a directory  A which represent bucket A. let’s suppose you created new data Bucket “B” so there is another directory with name “B”.  stop the couchbase server(service) and copy the file  /var/lib/couchbase/data/A /”master.couch.X”  (here X can be any number)  to   /var/lib/couchbase/data/B/ and  Start Couchbase service.

Now It should shows views in Admin section. 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.