2

May I save a couchbase db as a backup on the localfilesystem?

It should work on IOS and Android.

On IOS I have an App: "Files" with data "on my iphone" from Firefox or Recorder App or other Apps always in a directory. How can I save the backup in a directory in this location?

I found something about push replication with couchbase, but only remote. Is it possible to make a push replication to the local filesystem to solve this?

orgen
  • 170
  • 1
  • 11
  • Can you clarify, are you facing only on vue/native-script? and iOS/Android works fine? – Jay Dec 07 '20 at 15:20
  • I'm facing on nativescript - javascript and it should work on both, iOS and Android. Vue is not a must have. – orgen Dec 07 '20 at 16:27
  • You can use the DatabaseConfiguration to set the directory where the database is saved in iPhone folders like Application Support/Temporary etc, or a shared App Group which are accessible by the Application. But saving as a separate backup, what's the use case you are trying to solve? – Jay May 06 '21 at 04:59
  • Jay, to save some data, I don't want to go online. So I like to store it locally. – orgen May 06 '21 at 08:07
  • CouchbaseLite saves data locally. – Jay May 09 '21 at 04:34

1 Answers1

2

A Couchbase Lite database is a directory. Copying the directory will back up the database.

The backup, of course, will not stay up-to-date. Also, be careful using db copies in replication scenarios. Databases have ids that are assumed to be unique. Multiple copies (which will have the same id) will encumber the replication process.

G. Blake Meike
  • 6,615
  • 3
  • 24
  • 40