Pre-installation requirements:
The following software is required to run this script:
-
Docker: • sudo apt-get update • sudo apt-get install -y docker.io
-
Node.js: • sudo apt install -y nodejs
-
dhis2/cli: • sudo npm install -g @dhis2/cli
After download the script you need to chmod +x local_dhis_server.sh
The script takes a command-line argument to determine which function to call. The available options are: • reload: This argument spins up the DHIS2 instance and loads the dump. • up: This argument start the DHIS2 instance. • dump-db: This argument dumps the DHIS2 database to a compressed file. • down: This argument brings the DHIS2 instance down.
Example usage ./local_dhis_server.sh reload
If an invalid argument is provided, the script displays the usage instructions and exits.
Server starts on http://localhost:8080 by default, you can log to instance using username: admin, password: district
Downloading a Backup File from Atlassian.net
-
Log in to: • https://openlmis.atlassian.net/wiki/spaces/SELV/pages/557121570/Credentials+restricted
-
Backup file should be at the end of the page
-
Click on the "Download" button to download the backup file to your local machine and save it in /tmp directory. If you can't indicate where to save the file when downloading it you need to manually move the backup file to the tmp directory. Open terminal, go to place where you save the backup file using cd command and then use this command: mv backup.sql.gz /tmp/
If you notice any error you need to check if u have Node.js version 14 or newer. You can check this using the node -v command. To download the correct version of Node.js run this command: sudo apt install -y nodejs
If you encounter 'Invalid interpolation format' error while running the script, you should update your docker version to 18.06.0 or higher and docker-compose to 1.22 or higher