Program export

Hi devs,
I just tried for the first time the program metadata export (/api/24/programs/ID/metadata.json), importing the new results into a blank database. Great improvement over the previous «manual» export, but I have a couple of questions:

  • is it intentional that optionSets are included, but not the options?

  • is it intentional that custom forms are not included?

  • even if the import succeeded (apart from missing options and custom form), there were lots of warnings when importing for ProgramStage, Program and ProgramRuleAction. Since all of these were actually imported just fine, are the warnings needed? For example:

ProgramStage
Cause of death (anonymous)
Unknown reference to IdentifiableObject{id=0, uid=‘jo4akTBhEqq’, code=‘null’, name=‘null’, created=null, lastUpdated=null} (Program) on object IdentifiableObject{id=0, uid=‘wmSb9TmevMn’, code=‘null’, name=‘Cause of death (anonymous)’, created=Tue Oct 28 12:14:26 CET 2014, lastUpdated=Tue Jul 12 11:37:41 CEST 2016} (ProgramStage).
Program
Cause of death (anonymous)
Unknown reference to IdentifiableObject{id=0, uid=‘URhfxwrmnTO’, code=‘null’, name=‘null’, created=Wed Jul 13 15:30:54 CEST 2016, lastUpdated=Wed Jul 13 15:30:54 CEST 2016} (OrganisationUnit) on object IdentifiableObject{id=171, uid=‘jo4akTBhEqq’, code=‘null’, name=‘Cause of death (anonymous)’, created=Tue Oct 28 12:14:26 CET 2014, lastUpdated=Wed Jul 13 15:31:07 CEST 2016} (Program).

ProgramRuleAction
nX4x5K0b62k
Unknown reference to IdentifiableObject{id=0, uid=‘a5exvYDMawd’, code=‘null’, name=‘null’, created=null, lastUpdated=null} (ProgramRule) on object IdentifiableObject{id=0, uid=‘nX4x5K0b62k’, code=‘null’, name=‘null’, created=Thu Jul 07 12:07:29 CEST 2016, lastUpdated=Thu Jul 07 12:07:29 CEST 2016} (ProgramRuleAction).

Regards

Olav

- is it intentional that optionSets are included, but not the options?

No, I will have a look and fix/backport

- is it intentional that custom forms are not included?

No, I will have a look and fix/backport

- even if the import succeeded (apart from missing options and custom
form), there were lots of warnings when importing for ProgramStage, Program
and ProgramRuleAction. Since all of these were actually imported just fine,
are the warnings needed? For example:
ProgramStage Cause of death (anonymous) Unknown reference to
IdentifiableObject{id=0, uid='jo4akTBhEqq', code='null', name='null',
created=null, lastUpdated=null} (Program) on object
IdentifiableObject{id=0, uid='wmSb9TmevMn', code='null', name='Cause of
death (anonymous)', created=Tue Oct 28 12:14:26 CET 2014, lastUpdated=Tue
Jul 12 11:37:41 CEST 2016} (ProgramStage).
Program Cause of death (anonymous) Unknown reference to
IdentifiableObject{id=0, uid='URhfxwrmnTO', code='null', name='null',
created=Wed Jul 13 15:30:54 CEST 2016, lastUpdated=Wed Jul 13 15:30:54 CEST
2016} (OrganisationUnit) on object IdentifiableObject{id=171,
uid='jo4akTBhEqq', code='null', name='Cause of death (anonymous)',
created=Tue Oct 28 12:14:26 CET 2014, lastUpdated=Wed Jul 13 15:31:07 CEST
2016} (Program).

ProgramRuleAction nX4x5K0b62k Unknown reference to
IdentifiableObject{id=0, uid='a5exvYDMawd', code='null', name='null',
created=null, lastUpdated=null} (ProgramRule) on object
IdentifiableObject{id=0, uid='nX4x5K0b62k', code='null', name='null',
created=Thu Jul 07 12:07:29 CEST 2016, lastUpdated=Thu Jul 07 12:07:29 CEST
2016} (ProgramRuleAction).

This is caused by using the legacy importer, right now (2.23/2.24) you need
to use curl (or a similar http client) and push it directly to
/api/24/metadata endpoint, in 2.25 we will update the UI to use the new
importer.

···

--
Morten

Regards
Olav

The 2 issues should now be fixed and backported

···

On Mon, Jul 25, 2016 at 10:02 AM, Morten Olav Hansen morten@dhis2.org wrote:

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

  • is it intentional that optionSets are included, but not the options?

No, I will have a look and fix/backport

  • is it intentional that custom forms are not included?

No, I will have a look and fix/backport

  • even if the import succeeded (apart from missing options and custom form), there were lots of warnings when importing for ProgramStage, Program and ProgramRuleAction. Since all of these were actually imported just fine, are the warnings needed? For example:

ProgramStage
Cause of death (anonymous)
Unknown reference to IdentifiableObject{id=0, uid=‘jo4akTBhEqq’, code=‘null’, name=‘null’, created=null, lastUpdated=null} (Program) on object IdentifiableObject{id=0, uid=‘wmSb9TmevMn’, code=‘null’, name=‘Cause of death (anonymous)’, created=Tue Oct 28 12:14:26 CET 2014, lastUpdated=Tue Jul 12 11:37:41 CEST 2016} (ProgramStage).
Program
Cause of death (anonymous)
Unknown reference to IdentifiableObject{id=0, uid=‘URhfxwrmnTO’, code=‘null’, name=‘null’, created=Wed Jul 13 15:30:54 CEST 2016, lastUpdated=Wed Jul 13 15:30:54 CEST 2016} (OrganisationUnit) on object IdentifiableObject{id=171, uid=‘jo4akTBhEqq’, code=‘null’, name=‘Cause of death (anonymous)’, created=Tue Oct 28 12:14:26 CET 2014, lastUpdated=Wed Jul 13 15:31:07 CEST 2016} (Program).

ProgramRuleAction
nX4x5K0b62k
Unknown reference to IdentifiableObject{id=0, uid=‘a5exvYDMawd’, code=‘null’, name=‘null’, created=null, lastUpdated=null} (ProgramRule) on object IdentifiableObject{id=0, uid=‘nX4x5K0b62k’, code=‘null’, name=‘null’, created=Thu Jul 07 12:07:29 CEST 2016, lastUpdated=Thu Jul 07 12:07:29 CEST 2016} (ProgramRuleAction).

This is caused by using the legacy importer, right now (2.23/2.24) you need to use curl (or a similar http client) and push it directly to /api/24/metadata endpoint, in 2.25 we will update the UI to use the new importer.

Morten

Regards

Olav