You are on page 1of 12

DHIS2 Live

on Windows laptops/desktops
(NOT for production servers!!)
Knut Staring
January 2016
Preparation
• Java 8 (JRE):
http://java.com/en/download/manual.jsp
• PostgreSQL 9.5 (or
later):http://www.enterprisedb.com/products-
services-training/pgdownload#windows
• dhis2-live.zip http://www.dhis2.org/downloads
• Notepad++
https://notepad-plus-
plus.org/download/v6.9.html
Java and Postgres installation
• Install Java 8 with defaults
• Install PostgreSQL 9.5 and be sure to
remember the password.
In the final prompt, UNTICK the Stack Builder
option
Add Postgres to Windows Path
• Start button -> Right click Computer ->Properties –>
Advanced System Settings-> Advanced ->
Environment Variables
• Select “Path” and Edit. Go to the end and add a
semicolon
• After the new semicolon, add C:\Program
Files\PostgreSQL\9.5\bin
• Click OK, OK, OK
PgAdmin
• Open PgAdmin and log in
• Right-click Login Roles and enter “dhis” for
Role name. In the “Definition” tab, enter
“dhis” for the password (twice)
• Right-click on “Databases” and select “New
Database…”
• Enter “dhis2” for “Name” and “dhis” for “Role”
Demo database
• Skip this slide if you want an empty database
• Download sample data from
https://www.dhis2.org/downloads
• Unzip the download
• Open a Command Prompt window and
navigate to the new unzipped folder
• Type the following on the command line:
psql –U dhis dhis2 < default.sql
DHIS2 Live
• Unzip the downloaded DHIS2 Live package
• In subfolder “conf” open “dhis.conf” in
Notepad++ or WordPad (not NotePad)
• Remove all the “#” characters
• Add a “#” character in front of the top 5 lines
dhis.conf should look like this
• hibernate.dialect =
org.hibernate.dialect.PostgreSQLDialect
• hibernate.connection.driver_class =
org.postgresql.Driver
• hibernate.connection.url = jdbc:postgresql:dhis2
• hibernate.connection.username = dhis
• hibernate.connection.password = dhis

• hibernate.hbm2ddl.auto = update
Start up
• Put a shortcut to dhis2-live.exe on your
dashboard and click on it
• DHIS2 will start and open your browser to
http://localhost:8082 with and empty
database
• If this does not work, try
http://127.0.0.1:8082
Updating the version of DHIS
• Download a new version of DHIS2 from
http://dhis2.org/downloads
• Stop DHIS2 Live
• Go to the folder webapps/dhis and delete
everything
• Copy the new dhis2.war to the same folder
• Rename to dhis2.zip and unzip
Backup and restore
Startbutton -> “command”
Use cd to navigate to where you want to have your backups

Backup
pg_dump –U dhis –f dhis2sl_2016.sql -d dhis2

Restore
• Create a new empty database in PgAdmin, eg. dhis2_sl3
• psql –U dhis –f dhis2sl_2016.sql –d dhis2_sl3
Optional: Multiple DHIS2 Live
• More than one DHIS2 Live can run
simultaneously
• They must be on different ports
• In subfolder “conf” open “jetty.port”
• Change the port number (stay above 8000)
• Change database name in dhis.conf