synchronisation:introduction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
synchronisation:introduction [2025/04/01 14:59] – [Primary vs Central vs Mirror servers] Adrian Boonesynchronisation:introduction [2025/04/01 16:29] (current) – [Setting up or extending a sync system] Adrian Boone
Line 61: Line 61:
  
 Stores to be synced will exist as separate instances of the same store on more than one sync site: Stores to be synced will exist as separate instances of the same store on more than one sync site:
-  * on the central server - the store itself and its related preferences, along with name visibility in the store are editable => all stores must exist on the central server.+  * on the central server - the store itself and its related preferences, along with name visibility in the store are editable => all stores and their transaction data must exist on the central server.
   * on the primary server - item visibility in the store is editable => all stores must exist on the primary server   * on the primary server - item visibility in the store is editable => all stores must exist on the primary server
 <WRAP center round important 95%> <WRAP center round important 95%>
-On a mirrored sync system, the store must be created first on the central server. It will then sync to the primary server, where item visibility and/or master lists configured.+On a mirrored sync system, the store must be created first on the central server. It will then sync to the primary server, where item visibility and/or master lists can be configured.
 </WRAP> </WRAP>
-  * store data (e.g. store transactions, stock) can only be edited on a single sync site - the site on which the store is defined as //active//. This is controlled on the central server by assigning which site the store belongs to - see [[synchronisation:sync_sites|sync sites]].+  * store data (e.g. store transactions, stock) can only be edited on a single sync site - the site on which the store is defined as //active// - and this store data is synced to the central server, as a read-only copy. This is controlled on the central server by assigning which site the store belongs to - see [[synchronisation:sync_sites|sync sites]].
  
 Once a store has been set up (see the relevant parameters below), item and name visibility for the store needs to be set up - see [[other_stuff:virtual_stores#controlling_item_visibilitythe_master_lists_tab_or_the_visibility_tab|Virtual stores, Controlling item visibility]]: Once a store has been set up (see the relevant parameters below), item and name visibility for the store needs to be set up - see [[other_stuff:virtual_stores#controlling_item_visibilitythe_master_lists_tab_or_the_visibility_tab|Virtual stores, Controlling item visibility]]:
Line 75: Line 75:
  
 The table below is a high-level summary of the different data types: The table below is a high-level summary of the different data types:
-  * **//Central data//** can only be edited or imported on the primary server, and changes are synced to all sites  +  * **//Central data//** can only be edited or imported on the primary server (or sometimes the central server), and changes are synced to all sites  
-  * **//Central store data//** can only be edited or imported on the central server, but changes are only synced to the site where the store is visible +  * **//Central store data//** can only be edited or imported on the central server (or sometimes the primary server), but changes are only synced to the site where the store is visible 
   * **//Store data//** can only be edited or imported on the sync site where the store is //active//, and changes are only synced to any site where the store exists as a //collector// copy (e.g. the central server)   * **//Store data//** can only be edited or imported on the sync site where the store is //active//, and changes are only synced to any site where the store exists as a //collector// copy (e.g. the central server)
   * **//Patient data//** can only be edited on the sync site where its //home store// is //active//, and changes are synced to any site where the patient is visible   * **//Patient data//** can only be edited on the sync site where its //home store// is //active//, and changes are synced to any site where the patient is visible
Line 82: Line 82:
   * **//Local data//** can be edited or imported on any site but doesn't sync anywhere   * **//Local data//** can be edited or imported on any site but doesn't sync anywhere
   * **//Sync data//** can only be edited on the central server but doesn't directly sync anywhere   * **//Sync data//** can only be edited on the central server but doesn't directly sync anywhere
-  * **//Message data//** can be created on any site and syncs according to the sending/receiving store, but can'be edited anywhere+  * **//Message data//** can be created on any site, but can't be edited anywhere, and syncs according to the sending/receiving store
 +    * if the receiving store is setthen the message will be processed on the site where that store is active 
 +    * if the receiving store is blank and the sending store is set, then the message will be processed only on the central server 
 +    * if both are blank, then the message will be processed on all remote sites (i.e. all except the central server)
   * Some data can fall into more than one type, depending on the situation.   * Some data can fall into more than one type, depending on the situation.
  
-^  Data  ^  'Normal' Sync  ^  If using Mirror Sync ^  Notes  ^                                                                                                 +^  Data  ^  Type  ^  Editable  ^  Notes  ^                                                                                                 
 | Items | Central | Primary | Including item-related data e.g. item categories, units, BOM masters |  | Items | Central | Primary | Including item-related data e.g. item categories, units, BOM masters | 
-| Names (except patients) | Central | Primary | Including name-related data e.g. name categories, contacts, tags +| Names (except patients) | Central | Primary | Including name-related data e.g. name categories, contacts | 
 | Merging of items, units and names (except patients) | Central | Primary |  |  | Merging of items, units and names (except patients) | Central | Primary |  | 
 | Groups and departments | Central | Primary |  |  | Groups and departments | Central | Primary |  | 
Line 95: Line 98:
 | Purchase order categories | Central | Primary |  |  | Purchase order categories | Central | Primary |  | 
 | Custom data | Central | Primary |  |  | Custom data | Central | Primary |  | 
-| Barcodes | Central | Primary |  +| Barcodes | Central | Primary | Can be added on any site; duplicates are automatically merged when synced to the primary 
 | Currencies | Central | Primary |  |  | Currencies | Central | Primary |  | 
 | Options and properties | Central | Primary |  |  | Options and properties | Central | Primary |  | 
Line 113: Line 116:
 | Tenders and quotes (centralised) | Central store | Primary |  |  | Tenders and quotes (centralised) | Central store | Primary |  | 
 | Payments (centralised) | Central store | Primary |  |  | Payments (centralised) | Central store | Primary |  | 
-| Visibility of items and names (except patients) | Central store | Primary |  |  +| Visibility of items | Central store | Primary |  |  
-| Visibility of existing patients and prescribers | Central store | Primary |  | +| Visibility of names (including existing patients) | Central store | Central |  |  
-| Stores and non sync-related store preferences | Central store | Central | Managed on Central Mirror since v7.13  |  +| Visibility of existing prescribers | Central store | Central |  | 
 +| Stores and non sync-related store preferences | Central store | Central |  |  
 | Sites and sync-related preferences | Central | Central | Changes on the central server indirectly update related records on remote sites |  | Sites and sync-related preferences | Central | Central | Changes on the central server indirectly update related records on remote sites | 
 | Dashboard reports | Central | Central |  |  | Dashboard reports | Central | Central |  | 
 | Authorisers and authorisation | Central | Central |  |  | Authorisers and authorisation | Central | Central |  | 
-| Messages | Message | Store | Depends on sending and/or receiving store (which can be blank) +| Messages | Message | Store | Depends on sending and/or receiving store | 
 | Visibility of new patients and prescribers | Patient | Store | New visibility records sent to central server |  | Visibility of new patients and prescribers | Patient | Store | New visibility records sent to central server | 
 | Patients and prescribers | Patient | Store | Including patient-related data e.g. PMR, insurance policies |  | Patients and prescribers | Patient | Store | Including patient-related data e.g. PMR, insurance policies | 
-| Merging of patients and prescribers | Patient | Store |  |  +| Merging of patients and prescribers | Patient | Store | Both records must have the same home store |  
-| Patient events | Patient | Store | Dispensary data  +| Patient events | Patient | Store | Dispensary data | 
 | Repeats | Patient | Store | Dispensary data; preference can be set to allow processing on all sites where the patient is visible |  | Repeats | Patient | Store | Dispensary data; preference can be set to allow processing on all sites where the patient is visible | 
-| Prescriptions | Patient | Store | Preference can be set sync to all sites where the patient is visible | +| Prescriptions | Patient | Store | Preference can be set to sync to all sites where the patient is visible |  
 +| Adverse drug reactions | Patient | Store | Dispensary data |  
 +| Name-related tags, budgets and master-lists | Name | Primary |  |
 | Name notes | Store | Store |  |  | Name notes | Store | Store |  | 
 | Customer stock history and requisitions | Store | Store |  |  | Customer stock history and requisitions | Store | Store |  | 
Line 155: Line 161:
 | Logs | Local | Local |  |  | Logs | Local | Local |  | 
 | Reminders | Local | Local |  |  | Reminders | Local | Local |  | 
-| Adverse drug reactions | Local | Local |                                                                                                  | +                                                                                                
  
-==== Stores ==== 
- 
-These are a special case: 
-  * changes to the store record itself (all except the //Synchronisation// tab) are allowed only on the primary server, and then propagate on to any other sync sites as determined by the "syncs with" settings for that store on the sync server (i.e. to any other sync sites where "syncs with" is not //None//) 
-  * the store's sync preferences (the //Synchronisation// tab) are controlled on the sync server 
-  * a store should only ever be //Active// on one sync site at a time (usually on the site where it is //Local//) 
  
 ==== Centralised procurement ==== ==== Centralised procurement ====
Line 178: Line 178:
 ==== Dispensary data ==== ==== Dispensary data ====
  
-=== Stock transactions === 
- 
-By default, prescriptions and any other operations in dispensary mode which affect stock levels are not synced to the sync server, unless the //Include transactions in sync// option is enabled in the store sync preferences, as these can potentially generate a lot of sync traffic and there is usually no need for the central users to have this level of detail - the same site will usually have another store which supplies the dispensary and its transactions will be synced, and that's usually enough to infer usage for the dispensary store. 
- 
-If this preference is switched off in a dispensary store on a remote site, the following data will not be synced back to the central sync server: 
- 
-  * Transactions (including backorders, builds etc.) 
-  * Prescriptions 
-  * Stock lines 
-  * Stocktakes 
  
-If the preference is switched on, all of the store's transaction & stock data will be synced to the sync server. 
 === Patients === === Patients ===
  
Line 196: Line 185:
 Since mSupply v4.09, patients have a //home store//, initialised either according to the store they were created in, or according to their most recent prescription. Patients and their related data (patient medication records, repeats, insurance policies) can only be edited in an active dispensary store on the same //home site// where their home store is active. Since mSupply v4.09, patients have a //home store//, initialised either according to the store they were created in, or according to their most recent prescription. Patients and their related data (patient medication records, repeats, insurance policies) can only be edited in an active dispensary store on the same //home site// where their home store is active.
  
-Patients and their related data records will be synced to the primary server, and forwarded on to any other site which has an active/collector store in which the patient is visible. Prescriptions will be allowed in dispensary stores on any of those sites, except for repeats which can only be processed in dispensary stores on the patient's home site.+Patients and their related data records will be synced to the central server, and forwarded on to any other site which has an active/collector store in which the patient is visible. Prescriptions will be allowed in dispensary stores on any of those sites, except for repeats which can only be processed in dispensary stores on the patient's home site.
  
-Newly created patients will also be made visible in any other dispensary stores on the home site, depending on the store's visibility preferences. Subsequently, patient visibility is controlled from the primary server in the same way as for other name (customer & supplier) records.+Newly created patients will also be made visible in any other dispensary stores on the home site, depending on the store's visibility preferences. Subsequently, patient visibility is controlled from the central server in the same way as for other name (customer & supplier) records.
  
 === Other dispensary data === === Other dispensary data ===
Line 204: Line 193:
 Abbreviations, item directions, insurance providers and patient event types are treated as a special kind of system-specific data i.e. they are editable on the primary, but only synced to sites having at least one active dispensary store. Abbreviations, item directions, insurance providers and patient event types are treated as a special kind of system-specific data i.e. they are editable on the primary, but only synced to sites having at least one active dispensary store.
  
-Prescribers are also treated as a special kind of store-specific data, like patients i.e. they are editable in any active dispensary store on their home site, synced back to the primary server, and shared with dispensary stores on other sites where they've previously prescribed.+Prescribers are also treated as a special kind of store-specific data, like patients i.e. they are editable in any active dispensary store on their home site, synced back to the central server, and shared with dispensary stores on other sites where they've previously prescribed.
  
 === Transferring patients/prescribers to a different home store === === Transferring patients/prescribers to a different home store ===
  
-Watch this space...+This can be done only on the central server, by selecting a different dispensary store from the "Home store" pull-down menuIf you confirm that you want to start the transfer process, the patient/prescriber will become read-only and create a special type of message for the current home store's siteWhen that site syncs with the central server, the transfer process will complete. This makes the patient/prescriber visible in the new home store and then syncs any related records (e.g. prescriptions) to the new home store's site.
  
 ===== Transfers ===== ===== Transfers =====
Line 254: Line 243:
     * the received quantities for the original purchase order lines will be updated on the primary whenever the corresponding goods received lines are received there (and forwarded from there to the initiating store/site)     * the received quantities for the original purchase order lines will be updated on the primary whenever the corresponding goods received lines are received there (and forwarded from there to the initiating store/site)
     * when the primary receives any subsquent updates to goods received lines from the initiating store/site, it will update the quantities in the corresponding purchase order lines     * when the primary receives any subsquent updates to goods received lines from the initiating store/site, it will update the quantities in the corresponding purchase order lines
-  * If centralised procurement is not enabled, the received quantities for the original purchase order lines will be updated in the initiating store/site when it receives the goods received lines from the primary+  * If centralised procurement is not enabled, the received quantities for the original purchase order lines will be updated in the initiating store/site when it receives the goods received lines from the central server
  
 ===== Reporting ===== ===== Reporting =====
Line 305: Line 294:
   - Decide how to configure your server(s)   - Decide how to configure your server(s)
     * for a local combined primary and sync server:     * for a local combined primary and sync server:
-      * can your local server be online most of the time (it is more important that the internet to be reliable than for it to be fast)?+      * can your local server be online most of the time (it is more important for the internet to be reliable than for it to be fast)?
       * have you a fixed external IP address?       * have you a fixed external IP address?
       * can you open the necessary firewall ports to allow access to the local server from outside?       * can you open the necessary firewall ports to allow access to the local server from outside?
Line 321: Line 310:
     * single-user store/quiet dispensary (desktop): mSupply single-user desktop     * single-user store/quiet dispensary (desktop): mSupply single-user desktop
     * small store/clinic: mSupply mobile      * small store/clinic: mSupply mobile 
-  - Decide on the heirarchy of the stores you want to include+  - Decide on the hierarchy of the stores you want to include
     * which stores supply other stores?     * which stores supply other stores?
     * can stores which have the same supplying store transfer to each other, or just with the supplying store?     * can stores which have the same supplying store transfer to each other, or just with the supplying store?
-    * for dispensary stores, do you need to see prescription details on the central server 
   - Decide on the users for each site and their roles/permissions   - Decide on the users for each site and their roles/permissions
    
  • Last modified: 2025/04/01 14:59
  • by Adrian Boone