29.2 Import data

The import option allows different instance of DHIS2 to receive standardised sets of data in the absence of a networked system. The functionality can also be used to import data produced by another system (perhaps on a regular basis) or to import legacy data which has been transformed into a format which DHIS2 can understand. Typically, a data set is exported from one DHIS2 instance (e.g. a district level system) to another system (e.g. a provincial level system). DHIS2 is also capable of importing data directly from a DHIS2 1.4 Access database. Each of these options will be discussed in the following sections.

29.2.1 XML data import

To import data in XML format, simply select Services->Import-export->XML data import. Similar options to the XML meta-data import facility are available. Please refer to the Developer guide > Web API > Data values chapter on XML data import for details on the XML format which is used by DHIS2 for aggregate data import.

29.2.2 Import CSV data

DHIS2 supports import of data in the CSV (Comma Separated Values) format. This can be used to import exchange file produced by DHIS2 itself. It also comes in handy when you want to import data from a third-party system as CSV is widely supported in applications and is easy to produce manually.

To import a CSV data exchange file navigate to the CSV Data Import item in the left-side menu. Upload the exchange file and click Import . CSV files can be imported both as plain text file or as compressed ZIP file archive.

Please refer to the Developer guide > Web API > Data values chapter on CSV data import for a description of the CSV format to use.

29.2.3 Event data import

Event data can also be easily imported with the “Event data import” function. Refer to the section in the WebAPI for more information on the format used for importing events. Otherwise, the functionality is the same as the XML data import used for aggregate data.

29.2.4 Import PDF data

DHIS2 supports import of data in the PDF format. This can be used to import data produced by off-line PDF data entry forms. Please refer to the section “Data set management” for details on how to produce a PDF form which can be used for off-line data entry.

To import a PDF data file, navigate to the PDF Data Import item in the left-side menu. Upload the completed PDF file and click Import .

After the import process is finished, you can follow the link to the import summary, which will inform you about the outcome of the import process in terms of number of records imported, updated and ignored and potential conflicts.

29.2.5 Import data from DHIS2 1.4

There are two ways to import data from a DHIS2 1.4 database; 1) through the 1.4 XML-based export files, or 2) directly from the DHIS2 1.4 data file (.mdb). Both are accessible from the DHIS2 1.4 Import menu under Import in the Import-Export module.

It is critical that all data integrity violations which are present in the DHIS2 1.4 database be fully resolved before attempting an import into DHIS2. You can check the data integrity of DHIS2 1.4 through the CORE Module->Advanced->Data integrity checks. A report will be generated of all data integrity violations which should be resolved prior to importing into DHIS2.


When data is imported from DHIS2 1.4, both the meta-data as well as data are imported. You should therefore be exceedingly careful that the meta-data present in DHIS2 1.4 is compatible with your DHIS2 data, otherwise during a DHIS2 1.4 data import, the meta-data in the DHIS2 system will be potentially overwritten by the i DHIS2 1.4 File (database) Import

This method is recommend when doing large imports from 1.4, and especially when importing into a new DHIS2 database.

DHIS2 1.4 File Configuration

Before you can start the 1.4 file import you need to provide a few details about the 1.4 database:

Datafile(#): Here you put the full path to the DHIS2 1.4 data file you want to import from, e.g. C:\DHIS14\DHIS_#LR_LIBERIA.mdb.

Username: Leave blank (unless you have set up extra security measures on the file)

Password: Leave blank (unless you have set up extra security measures on the file)

Levels: Provide the number of levels in the orgunit hierarchy in your 1.4 database, e.g. 5.

Click “Save” and you will return to the DHIS2 1.4 File Import window.

Import Type:

As with other imports you have the options to Import (directly), Preview, or Analyse the import. We recommend using the Analyse option first to check that the 1.4 database is OK and ready to be imported.

When importing a large database into a new blank DHIS2 database we recommend using the Import option to save time.

For smaller incremental imports the Preview is OK.

Last Updated:

If you want the full import, all the data in the 1.4 database you leave this field blank.

If you only want to do an incremental import into an already existing DHIS2 database you can use this field to filter which data values to import. Only values added or edited after the date you specify will be imported. This filter makes use of the LastUpdated column in the RoutineData table in the DHIS2 1.4 data file.

Import process:

When you are done selecting Method, and LastUpdated you can begin the import by clicking on the Import button. This process might take a long time, depending on how many data values you are importing. On a reasonable spec. computer the import takes about 2 million records per 30 minutes. DHIS2 1.4 XML Import

Import though XML data from DHIS2 1.4 is also possible using the standard DHIS2 1.4 export format. Just be sure that the DHIS2 1.4 export format has been set to “DHIS 2” as illustrated in the screen shot below. After the data has been exported by DHIS2 1.4, you can import the data by choosing “Services->Import-Export->DHIS 1.4 Import->DHIS2 1.4 XML Import” and proceeding via the procedure outline in the previous section . Limitations to DHIS2 1.4 imports

Although it is possible to import and export data between instances of DHIS2 1.4 and DHIS2, there are significant limitations. Currently, the import of some metadata is not supported from DHIS2 1.4 to DHIS2. This includes:

  • Organisational unit alternate names

  • Compulsory data element pairings

  • Custom data entry forms

  • Dataset data entry levels

It is also important that the aggregation operator defined in DHIS2 1.4 be set to the correct value. Some data, such as population, should have their aggregation operator set to “Average” in DHIS2, as this controls how the aggregation of data is handled over time (but not within the organisational unit hierarchy).