couchbase iOS: exporting database to .cblite format

80 views
Skip to first unread message

Souhail Marghabi

unread,
Apr 30, 2015, 8:47:53 AM4/30/15
to mobile-c...@googlegroups.com
Greetings Everyone,

I am building an iOS app and arrived at a point where the sync gets slow as too many documents are involved. I have thought that packaging my app with pre build db is a good solution. Hence, I have tried to get the cblite file from my simulator internal documents which works well but since my db uses filtered channels it doesn't have all the data. My question, how can I export the full data of my remote database to a cblite format(I have read somewhere about the  liteServ Mac OS app, but I didn't know how to use it for that purpose if possible).  Any help is apreciated.

Thanks in advance

Jens Alfke

unread,
Apr 30, 2015, 12:47:19 PM4/30/15
to mobile-c...@googlegroups.com
On Apr 30, 2015, at 5:47 AM, Souhail Marghabi <souhail....@gmail.com> wrote:

My question, how can I export the full data of my remote database to a cblite format

You could temporarily modify your app so it doesn’t specify a filtered channel list when it replicates.

(I have read somewhere about the  liteServ Mac OS app, but I didn't know how to use it for that purpose if possible).  Any help is apreciated.

LiteServ is a faceless app that just exposes the CBL REST API. It listens on port 59840 by default. To tell it to pull from your server you’d POST to /_replicate, with a JSON document body like
{"source":"http://example.com/db", "target":"localdb", "create_target":true}
After the replication completes there'll be a local database named 'localdb' in LiteServ's database storage, which is in ~/Library/Application Support/com.couchbase.LiteServ/

If you need more details about the REST API you can find them in our online docs.

—Jens
Reply all
Reply to author
Forward
0 new messages