Copy/Transfer SQL View to a new instance

We are transferring metadata from a DHIS2 instance to production. We have 15 SQL Views that need to be copied. We have developed custom HTML reports using those views. We do not see any option to export and import the SQL Views and custom reports. I know we can create the SQL views, then we have to manually update all our custom reports.

Any idea?

import metadata from …/api/sqlViews?fields=:all
Although I never tried it.

1 Like

Thanks @Monjur! If you’d like to try it and more there’s more info about this in the developers portal (Data Mutation | DHIS2 Developer Portal)

In the, for instance, the API URL will be ( So I’d say the same thing for the custom reports, (*)

@Monjur thanks for the lead! And @Gassim thanks for clarification!

We managed to transfer both sqlviews and reports based on your guidance. Although the report file was too big for us to import, but we split and managed to upload.

1 Like