Multiple Dolibarr installations syncing to cloud

Hello all, I am new to Dolibarr, I have a few questions:

Can Dolibarr be installed in multiple locations (say I have 2 or 3 shops) and I install Dolibarr on a server in each, so if internet cuts they can continue operating somewhat. Is it then possible to have the 2-3 dolibarr sync up to the cloud dolibarr (dolibarr on a VPS with backups) so that I can see all of their transactions and sales and stuff? Each Dolibarr can have a unique identifier so I know which receipt can from which stop.

Hello,
I dealt with the problem (installing Dolibarr on different balanced servers).
Even if the project didn’t start, I had verified that the solution was feasible, even if it was more a hardware problem (load balancer, …) and tools configuration.
From Dolibarr’s point of view the only difficulty, the one relating to the sessions, seemed to me managed and surmountable.

Thank you, I think so to, but seeing if others have direct experience.

All you need is to setup a task to synchronize databases from the slaves (shop installation) to the master (main installation) and vice-versa. However, there will be a lot of issues, some fixable, some not.

Fixable: You must have unique masks for each module (proposals, invoices, etc.) so there won’t be reference duplicates.
Not fixable: Each shop, during a blackout/connection loss, will create an invoice record in the database with its ID. There is a 100% chance, that during a connection loss, each shop will create an invoice in its slave database with the same UNIQUE id. When the connection is established, which ID will be synced? You cannot sync all 3 of them if you have 3 slave installations. I.e. first sync job will pass, and the other 2 will not.

The same stand for all other records, that may be created on slave installation(s) during connection loss.

With the above said, the only solution is to have a custom-made module that will “take” the data from the slave database, rework it a bit, and instead of copying the database record as it is, have a code to create a new invoice on the master server. And here comes the next issue: reference number of records. To fix this issue, see above.

Welcome to paragraph 22. :slight_smile:

Or … take the record from the slave, create a new record (with the same data but a different ref) on the master, and then dump the records on the slave and copy those from the master. This is a possible workaround, but during the slave update, slave installation will not be usable, as this update cannot be done for just a few seconds. Depending on the records, it may take a minute or 2, or even more.

I am thinking, what if, each shop has an ID in front of each DB item/stuff, so even if two shops make up the same receipt number for example 010, it would be 01-010 and 02-010. This could apply to all IDs, namely each shop would put an their shop ID before the Unique ID.
Thoughts?

This will make Dolibarr unupgradable.

So I think your method is better since would keep Dolibarr upgradable?

My suggestion is to write an external module to handle this, but … this module must have two-way code for ALL modules you will use on the slave servers. it’s not an easy tasks :slight_smile:

Well it only needs POS and inventory at first.