Force Server to reset to client's database state

15 views
Skip to first unread message

goo...@marco.betschart.name

unread,
Nov 21, 2015, 5:22:23 PM11/21/15
to Couchbase Mobile
Hi @all

I'm trying to implement a local backup & restore procedure, so the client is able to to a full database restore within the app.
Additionally I'm replicating the couchbase lite database to a couchbase server.

Unfortunately exactly this sync is now causing me headaches:

Imagine a local backup created at 2015-11-21 at 13:00.
After creating the backup, I create a document "BadDocument" which is synced to the server at 2015-11-21 at 13:05.
As soon as I restore the backup and start syncing, the document "BadDocument" gets downloaded from the server - which is wrong.

How can I force the server in this situation to reset it's data to the one the customer has on his device (and was restored from the local backup)?

FWIW: I'm using one bucket on the server, holding all data from each customer separated by one-channel-per-customer.

Jens Alfke

unread,
Nov 21, 2015, 8:14:39 PM11/21/15
to mobile-c...@googlegroups.com

On Nov 21, 2015, at 2:22 PM, goo...@marco.betschart.name wrote:

I'm trying to implement a local backup & restore procedure, so the client is able to to a full database restore within the app.
Additionally I'm replicating the couchbase lite database to a couchbase server.

Isn’t this the same question you asked a week ago? I posted an answer then.

—Jens

goo...@marco.betschart.name

unread,
Nov 22, 2015, 4:48:30 AM11/22/15
to Couchbase Mobile
Hi Jens

Yes you're right. I didn't get any notifications about your response it seems :(
So the only thing missing from my end it seems is to delete all documents which are newer than the backup after the replication has finished the first time.

Then it should all work I think :)

Thank you very much for your help & patience!!

Am Sonntag, 22. November 2015 02:14:39 UTC+1 schrieb Jens Alfke:
Reply all
Reply to author
Forward
0 new messages