Backing up dhis2 instance

Hello Team
How do we backup the dhis2 instance, the tomcat server configuration plus the PostgreSQL configuration?

Hi Raphael,

I think you will find what you are looking for in the implementer’s documentation under the section DHIS2 Tools Reference - search for dhis2-backup here: https://docs.dhis2.org/master/en/implementer/html/dhis2_implementation_guide_full.html#dhis2-tools-reference

2 Likes

HI @Kenyuri.

Please note that the tool @chase.freemanis referring to is an automatic tool part of the dhis2-tool package which is the old version of https://github.com/bobjolliffe/dhis2-tools-ng Anyway, the suggested command will only backup the database.

In case you want to backup your PostgreSQL configuration you should have a look at: https://docs.dhis2.org/2.35/en/dhis2_system_administration_guide/installation.html#postgresql-installation
In case you want to backup your Tomcat Server configuration you should have a look at: https://docs.dhis2.org/2.35/en/dhis2_system_administration_guide/installation.html#tomcat-and-dhis2-installation
… and also, you probably want to get your Apache/Nginx configuration: https://docs.dhis2.org/2.35/en/dhis2_system_administration_guide/installation.html#reverse-proxy-configuration

As you can see from there you might need to backup not only the configuration files but some variables defined and scripts. Also think about the system users that you have might created etc.

My recommendation would be that you follow all the steps performed during installation to see what you did and collect them in a document (including static files like configuration ones). Then, write a system script that can periodically backup the files you want to a external (ideally) destination. This would probably be only the database.

Cheers.

3 Likes