vrijdag 29 juli 2011

restoring couchdb database from backup .couch file

hi

at my work we're using couchdb running on ubuntu server 10.04 to log some stuff
the db was growing near the disk space, and the person responsible was absent (due to the holiday season).
so i shut down couchdb.. moved the .couch file to a diferent location and recreated the database as an empty db so the logging of data would continue.

when the person returned from holiday they needed the data, so they first took what they needed from the new db file.
After this they asked to restore the big DB file.



make sure in the new instance of couch the appropriate database has been created

shut down couchdb (/etc/init.d/couchdb stop )

restore the file to it's original location (if there is data in the new file you might want to make a backup of that first)
make sure the .couch file has the correct owner & group .. (in my case both couchdb, look at the new file to know for sure)
restart couchdb (/etc/init.d/couchdb start)


should be all done


Greetz

Wouter