I want to replace my empty database and replace it with a demo database i am using dhis2 version 2.41.4 what are the steps and guides?
Hi @Tahir_Zaman,
Thanks for your patience! How did you install the instance, using Docker Compose, d2 CLI or direct installation on Ubuntu?
In a regular Ubuntu installation,
First, run this command: sudo -u dhis tomcat-dhis/bin/shutdown.sh
Second, you will need to download the database for the same version from (https://databases.dhis2.org/) and then run the following command in the terminal.
gunzip -c dhis2-db-sierra-leone.sql.gz | psql -d <database-name> -U <database-user>
- You will need to run this in the same path.
Then run: sudo -u dhis tomcat-dhis/bin/startup.sh but update the username to the user you used when installing the instance.
If you used a D2 installation:
If you used the d2 CLI, you can follow the instructions to see the database using the d2: Spin up a stable version | DHIS2 Developer Portal
If you used Docker Compose:
First run, docker-compose down,
Second, you will download the database for your version from (https://databases.dhis2.org/) and then run gunzip -c dhis2-db-sierra-leone.sql.gz | docker exec -i <container_name> psql -d <database-name> -U <database-user>
Finally, run docker-compose up -d.
Note: Analytics Tables Export:
One final step you will need to do after the import is done is to run the Analytics Tables export in the Data Administration app.
I hope this helps. Please keep us updated on how this works for you. Thanks!
Thanks @Gassim i used the automated installation on Ubuntu and setting the anisible_connection to ssh. though i was able to successfully place the demo database by creating new database and then importing the demo tables and data by postgres user as psql and then changing the dhis.conf file in opt/dhis2/dhis.conf.
Thanks Again for the support