Before installing NLIMS DATA SYNCHRONISER, ensure that the following requirements are met:
- Ruby 2.5.3
- MySQL 5.6
- Rails 5
- Couchdb 3.2.1
Install by following this guide: Couchdb installation
-
Checkout to the
masterbranchgit clone https://github.com/HISMalawi/nlims_data_syncroniser.git git checkout master
-
Open the respective configuration files in the
configfolder: Copy the .example file to respective .yml file e.gcp database.yml.example database.yml
database.yml: Configure your database settings. Same database as nlims_controllercouchdb.yml: Configure your CouchDB settings. This should be the same as that of nlims_controllerapplication.yml: Edit application-specific configurations as required.
-
Update the configuration settings in these files to match your environment.
-
Install project dependencies using Bundler. Run the following command in your project directory:
bundle install
If you are installing the app for the first time, follow these steps:
-
Create the database:
rails db:create
-
Run database migrations:
rails db:migrate
If you already have NLIMS DATA SYNCHRONISER running, check the following if they are ok:
couchdb.ymlconfig file is the same as that ofnlims_controller- If you can access it via the browser(usually runs on port 3008) and the interface has CHSU and the local site the last seen status as
online - Make sure the the local site name displayed is the same as that written to
application.ymlconfig file otherwise rename the name in the file to that being displayed on the interface.
- Access the application on the browser and navigate to
New sitebutton and addNLIMS CHSUconfiguration as below:
- Add
Local siteso that its able to communicate with NLIMS CHSU via theAdd Sitebutton, The local site name should be the same as that in theapplication.ymlof the config folder. Should the site name not appear on the list of site whenadd sitebutton is pressed, Add the site vianew sitebutton and come back toadd sitesection and search through the list to find the created site:
- Add NLIMS CHSU so that its able to communicate with local site via the
Add Sitebutton:
- Add the 2 site should result in this communication:

- If you made a mistake you can edit these via
Edit sitesection. In this section you can disable and enable the sites for syncing.
0 * * * * /bin/bash -l -c 'cd /var/www/nlims_data_syncroniser/ && rvm use 2.5.3 && RAILS_ENV=development bundle exec rake nlims:sync_from_couchdb_to_couchdb --silent >> log/sync_couchdb_to_couchdb.log 2>&1'NOTE: Should the status of chsu be offline-check if you can ping chsu server, if local site is offline - check if the name of the site is the same as that in application.yml. Add only 2 sites(one chsu and the other local site) and disable others.