Transferring CouchDB .couch files from Windows to

2019-07-20 08:28发布

Am currently working on a CouchDB project, and have recently decided to switch to a Linux environment for development as I plan to deploy on a Linux server.

I was hoping to copy over my .couch files straight from - Program Files/Apache Software Foundation/CouchDB-1-1-1/var/lib/couchdb - and paste them directly into what I guess should be - var/lib/couchdb - But I keep running into file/folder permission errors each time I try to access var/lib/couchdb.

Is it even possible to transfer .couch files in the way I envisage?

...

Update - Follwing up on Dominic's comments, I managed to apply the fix found in the answer below.

1条回答
Rolldiameter
2楼-- · 2019-07-20 09:24

After some investigative work, I found it to be a permissions error, exactly as Dominic Barnes had suggested in the comments...

The issue is also discussed here - Staging setup with couchdb

To fix it, I first ran;

sudo chmod -R 755 var/lib/couchdb

I may have also changed the permissions on the relevant parent folders too. I was then able to copy my .couch files into var/lib/couchdb/COUCH-VERSION-NUMBER. After doing that, I then had to use chmod to set favourable write permissions on the newly copied files, but also had to run:

sudo chown couchdb var/lib/couchdb/COUCH-VERSION-NUMBER/

To open those files up to the user group (the "couchdb" group) that the couchdb installation sets up for internal use (I think...). After that, I restarted couchdb, forcing it to stop with:

ps -U couchdb -o pid= | xargs kill -9 

and restarting with:

/etc/init.d/couchdb start

After that, everything seemed to work as expected. Hope that helps anyone else running into the same problem.

查看更多
登录 后发表回答