Migrate couchdb data from 0.10.0?
For a linux system, I've backed up an old database from couchdb 0.10.0, basically a tar archive of the /var/lib/couchdb directory.
What is the procedure to convert this data in the format required by couchdb 1.0.1? If I simply restore the files to their original location, they are not found. If I place them in /var/lib/couchdb/1.0.1, I get the following error:
{"error":"kill","reason":"{gen_server,call,\n [couch_server,\n {open,<<\"test\">>,\n [{user_ctx,\n {user_ctx,null,\n [<<\"_admi开发者_开发知识库n\">>],\n <<\"{couch_httpd_auth, default_authentication_handler}\">>}}]},\n infinity]}"}
(In this case the database is named test.couch, I placed test.couch in /var/lib/couchdb/1.0.1/test.couch and tried to open it from the URL: http://localhost:5984/test/)
edit: oops, the solution was pretty obvious. Copying was the right thing to do, but I forgot to change permissions.
So, to restore a backed up couchdb database, all that is needed is:
sudo chown couchdb:couchdb backup/test.couch
sudo mv backup/test.couch /var/lib/couchdb/1.0.1
You could try replication between a 0.10 and 1.0.1 server although I'm pretty sure that 1.0.1 can read 0.10 databases. Is there more information in couch.log?
精彩评论