views:

872

answers:

3

I have a need to migrate some CouchDB database data back and forth between two desktop computers at different locations. One of the computers is Windows XP, one is a Macintosh running OS X 10.5. Neither can realistically connect to the other via the internet (the PC has a firewall, the Mac doesn't have fast internet access). But I do have a USB thumb drive I take back and forth.

Is there a way to do a database dump (like mysqldump for MySQL) for CouchDB so I can export from one and import to the other? I read about database replication but it seems to be only between two live databases that can talk to each other. I can copy the raw database files but I am not sure what version of CouchDB the PC is running (it's whatever the latest native windows CouchDB installer is, it tells me 0.0.0), the Mac is running the most recent version of CouchDBX, and I'm not sure the file versions are compatible.

The replication & versioning features of CouchDB are very intriguing for my application so I am looking forward to getting this set up.

edit: it seems like you either need:

  • couchdb replicating directly to another (or the same) couchdb server
  • couchdb database files from the same version of couchdb
  • couchdb-python tools ("couchdb-dump" and "couchdb-load") but I can't get them to work reliably on WinXP+Python 2.6.2 for some reason (dump 'works' but load says it fails integrity check)

This is really frustrating. :/

A: 

One of the concepts of Couch DB is having disconnected replicas of information, just like the offline Notes databases supported distributed information management. It is therefore probably a common situation to have a disconnected dataset in one CouchDB instance replicating it then and now against other server instances.

In this configuration your application may deal with changes in either systems, it will at least detect conflicts and gives you a chance to deal with them. It is exactly this scenario i'm currently experimentig with to have a common set of information on both my mostly disconnected laptop and my "server" at home.

Ralf Edmund
please tell me if you find a solution.
Jason S
+1  A: 

There have been some experimental binaries released for Windows but it is very early days for Windows versions of CouchDB - expect some issues if you are doing a Windows install.

I'm guessing you have the Mac at home and maybe Windows at work behind a corporate firewall. The firewall shouldn't block port 80. If you can telnet to the Mac's IP address on port 80 from the PC, replication should be possible via port 80.

Alternatively, couchdb-python includes the couchdb-dump utility. If you are running couchdb 0.9.1, you will need couchdb-python 0.6.0 to work with couchdb.

couchdb-dump --version will confirm your couchdb-python version

Something like:

couchdb-dump http://localhost:5984/prod > 20090724.dump

will dump a database named prod from couchdb running on the default port into a serialized file named 20090724.dump. It will list the id of each document it is outputtting and also any design documents.

With couchdb 0.9.1 and couchdb-python 0.6.0, this should all work well on OS X (I've just tried it on my Leopard machine). I'd suggest getting this setup on the Mac and confirming the steps before then looking at the windows equivalent.

timbo
A: 

Couchfuse may be an option you are interested in. "Couchfuse is a FUSE filesystem that exposes Couchdb databases as filesystem folder."

Mark Essel