Sync Gateway persist configuration changes done by REST api after reboot


#1

Hi!

I’m playing with the Sync Gateway REST Api to alter the configuration creating databases and pointing them to Couchbase Server buckets but I have noticed that all the changes that I apply are not saved anywhere if for any reason the Sync Gateway is rebooted and all the changes made by the REST Api become lost.

Is there a way to persist that type of changes done on the configuration of Sync Gateway or when trying to synchronize from Couchbase Lite I have to check first if the database has been created yet on Sync Gateway or needs to be created before any replication.

Thanks!

Bernat


#2

SGW is stateless so you will have to use the REST API to make those config changes again on restart…(else it will use the one that the SGW is launched with)


#3

Thanks @priya.rajagopal for your answer!


#4

Just quick follow up. You may want to check out configServer which allows you to specify a endpoint to fetch DB config . Of course, this may not be entirely applicable in your case since your config is created on the fly but if you have a way of persisting the config on this server, then you could fetch it. Just mentioning this as an option …