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 play.dhis2.org, for instance, the API URL will be (https://play.dhis2.org/2.36.3/api/sqlViews?fields=:all). So I’d say the same thing for the custom reports, (https://play.dhis2.org/2.36.3/api/reports?fields=*)

@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