If you want to share a development database or move your current production database to BAO Systems hosting platform, the best way to share your current database is to generate a file BAO can import using the commands below.
Our preferred command will create a plain-text dump. Please run this command, zip the output file, and send to us. Please include a note indicating which version of DHIS2 the database was created with.
pg_dump --format=plain --no-owner --no-privileges --exclude-table=_* --exclude-table=aggregated* --exclude-table=analytics* --exclude-table=completeness* --exclude-table=geography_columns --exclude-table=geometry_columns --exclude-table=raster_columns --exclude-table=raster_overviews --exclude-table=spatial_ref_sys --schema=public --dbname=YOUR_DATABASE_NAME > dhis-export.sql
If you would like to exclude the DHIS2 'audit' table because of size considerations, you can add a flag to exclude the audit table:
pg_dump --format=plain --no-owner --no-privileges --exclude-table=_* --exclude-table=aggregated* --exclude-table=analytics* --exclude-table=completeness* --exclude-table=geography_columns --exclude-table=geometry_columns --exclude-table=raster_columns --exclude-table=raster_overviews --exclude-table=spatial_ref_sys --exclude-table=audit --schema=public --dbname=YOUR_DATABASE_NAME > dhis-export.sql