← Back to team overview

dhis2-devs team mailing list archive

Re: [Dhis2-users] Metadata Import of option sets not working

 

Please try again with latest versions.

On Thu, Feb 11, 2016 at 2:13 PM, Morten Olav Hansen <morten@xxxxxxxxx>
wrote:

> Hm, ok. I see, let me look into it (I always generate my own UIDs when
> doing imports.. as its easier for connecting refs etc).
>
> On Thu, Feb 11, 2016 at 2:10 PM, Archana Chillala <
> archanac@xxxxxxxxxxxxxxxx> wrote:
>
>> Hi Morten,
>>
>> We have verified it again, the metadata import of option sets is still
>> not working. From the JSON file you sent us, what we figured out is that,
>> the options we are creating do not have IDs generated. The same is the case
>> on 2.22 as well.
>>
>> Please find the snapshot below that caused while creating a new option
>> for an option set.
>>
>>
>> [image: Inline image 2]
>> Any suggestions would be appreciated.
>>
>> Thank you.
>>
>>
>> Archana Chillala
>> Application Developer
>> Email archanac@xxxxxxxxxxxxxxxx
>> Telephone +91 9100960533 <+91+9100960533>
>> [image: ThoughtWorks]
>> <http://www.thoughtworks.com/?utm_campaign=archana-chillala-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>
>>
>> On Wed, Feb 10, 2016 at 2:12 PM, Morten Olav Hansen <morten@xxxxxxxxx>
>> wrote:
>>
>>> Hi Archana
>>>
>>> I have tested this on 2.21, 2.22 and trunk now, and it seems to be
>>> working fine on all versions. I'm including a working metadata
>>> option/optionSet import which you can check your own dump against.
>>>
>>> You can import it with:
>>> curl -X POST -d @metadata.json -H "Content-Type: application/json" -u
>>> user:pass http://server:port/api/metadata
>>>
>>> On Wed, Feb 10, 2016 at 12:44 PM, Morten Olav Hansen <morten@xxxxxxxxx>
>>> wrote:
>>>
>>>> Could you share your full payload? it shouldn't be too big.
>>>>
>>>> Did you also test against 2.22? was it working there?
>>>>
>>>> On Wed, Feb 10, 2016 at 12:33 PM, Archana Chillala <
>>>> archanac@xxxxxxxxxxxxxxxx> wrote:
>>>>
>>>>> Hi Morten,
>>>>>
>>>>> We are exporting both Option sets and options as well. Basically,
>>>>> making an API call - to export and import metadata (GET and POST call
>>>>> respectively) (http://...../api/metadata) .
>>>>>
>>>>> Thank you.
>>>>>
>>>>>
>>>>> Archana Chillala
>>>>> Application Developer
>>>>> Email archanac@xxxxxxxxxxxxxxxx
>>>>> Telephone +91 9100960533 <+91+9100960533>
>>>>> [image: ThoughtWorks]
>>>>> <http://www.thoughtworks.com/?utm_campaign=archana-chillala-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>
>>>>>
>>>>> On Wed, Feb 10, 2016 at 10:58 AM, Morten Olav Hansen <morten@xxxxxxxxx
>>>>> > wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> Are you exporting both optionSets -and- options? if not, all that is
>>>>>> inside the optionSets are the references to options, not the actual options.
>>>>>>
>>>>>> On Wed, Feb 10, 2016 at 12:23 PM, Archana Chillala <
>>>>>> archanac@xxxxxxxxxxxxxxxx> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> We have two instances of DHIS. Metadata is exported from one
>>>>>>> instance and imported into the other in the form of JSON file. But, while
>>>>>>> importing metadata, option set is imported but not the options within it.
>>>>>>> We are currently using DHIS version 2.21 revision number 21021.
>>>>>>>
>>>>>>> We have import conflicts mentioned as follows:
>>>>>>>
>>>>>>> "type": "OptionSet",
>>>>>>>      "importConflicts": [
>>>>>>>        {
>>>>>>>          "object": "Test options",
>>>>>>>          "value": "Unknown reference to IdentifiableObject{id=0,
>>>>>>> uid='null', code='1', name='option 1', created=null, lastUpdated=null}
>>>>>>> (Option) on object IdentifiableObject{id=73, uid='fvm4lIOVDnY',
>>>>>>> code='null', name='Test options', created=Tue Feb 09 12:14:03 IST 2016,
>>>>>>> lastUpdated=Tue Feb 09 12:14:27 IST 2016} (OptionSet)."
>>>>>>>        },
>>>>>>>        {
>>>>>>>          "object": "Test options",
>>>>>>>          "value": "Unknown reference to IdentifiableObject{id=0,
>>>>>>> uid='null', code='2', name='option 2', created=null, lastUpdated=null}
>>>>>>> (Option) on object IdentifiableObject{id=73, uid='fvm4lIOVDnY',
>>>>>>> code='null', name='Test options', created=Tue Feb 09 12:14:03 IST 2016,
>>>>>>> lastUpdated=Tue Feb 09 12:14:27 IST 2016} (OptionSet)."
>>>>>>>        }
>>>>>>>      ]
>>>>>>>
>>>>>>>
>>>>>>> Is this a bug? A similar issue was reported as a bug on launchpad
>>>>>>> for 2.18 version.
>>>>>>> Here's the link - https://bugs.launchpad.net/dhis2/+bug/1434035
>>>>>>>
>>>>>>> Any suggestions or help would be appreciated.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks & Regards,
>>>>>>>
>>>>>>> Archana Chillala
>>>>>>> Application Developer
>>>>>>> Email archanac@xxxxxxxxxxxxxxxx
>>>>>>> Telephone +91 9100960533 <+91+9100960533>
>>>>>>> [image: ThoughtWorks]
>>>>>>> <http://www.thoughtworks.com/?utm_campaign=archana-chillala-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Mailing list: https://launchpad.net/~dhis2-users
>>>>>>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>>>>>>> Unsubscribe : https://launchpad.net/~dhis2-users
>>>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Morten
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Morten
>>>>
>>>
>>>
>>>
>>> --
>>> Morten
>>>
>>
>>
>

PNG image


Follow ups

References