Is it possible to copy couchdb directly to sdcard on android devices?

妖精的绣舞 提交于 2019-12-25 05:37:35

问题


I see that the couchdbs are stored in the /sdcard/Android/data/my.app.package/db/ as .couch files. I was trying to copy the couchdb directly to sdcard and make the couchdb service recognize it. We have a large amount of data in the cloud stored in couchdb and replicating it everytime during testing takes a lot of time and being able to copy it directly will hasten the development process. Is it possible to do this? if yes, how and is there any special care needed to make the android couchbase service recognize the couchdbs copied?

Thanks.


回答1:


It is possible to copy .couch files between instances of CouchDB that share a common database format. If you've got two 1.1.0 CouchDB's, then you can cp (or similar) the .couch file into a running instance of another 1.1.0 CouchDB and it should "just work." Sometimes, you can successfully copy a .couch file "up" a version (ex: 1.1.0 to 1.2.0), but your mileage may vary.

I'm not sure what version of CouchDB the last active CouchDB for Android uses, but theoretically it would work the same--once you know what version it's based on.

TouchDB, the new CouchDB replication compatible database from Couchbase does not use the same .couch format, nor does Couchbase Server 2.0. Copying a .couch file from any version of CouchDB into one of those will not work as the database formats are significantly different (especially for TouchDB which uses SQLite underneath).

CouchDB-to-CouchDB, though, is typically fine as long as you keep an eye on the version numbers.



来源:https://stackoverflow.com/questions/9214545/is-it-possible-to-copy-couchdb-directly-to-sdcard-on-android-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!