Local Replication of Databases
Couchbase Lite supports replication between two local databases. This allows a Couchbase Lite replicator to store data on secondary storage. It is especially useful in scenarios where a user’s device may be damaged and its data moved to a different device.
let targetDatabase = DatabaseEndpoint(database: database2) let config = ReplicatorConfiguration(database: database, target: targetDatabase) config.replicatorType = .push self.replicator = Replicator(config: config) self.replicator.start()
Note: The code does not compile in Couchbase Lite Community Edition.