How do I edit org unit unique ID on DHIS2 version 2.34

I need help. I imported org unit from metadata but discovered some facilities were given auto-generated ID’s because the field was blank on the metadata.
As a result of this, the data for the affected facilities cannot be pulled from the organisation that manages our data through API because the ID for the affected org units are in conflict with the organizations ID for those facilities.

Please, how do I edit the org ID to correspond to our partners org ID to allow for the data pull.

Hi @nnenna,

I don’t think there is a direct way to change the auto-generated ID of an orgunit, and I think it is better to not have control to change them manually. you don’t need too, you don’t even need to care about what gets automatically generated as an ID for each orgunits, because DHIS provides other fields that you can use as an identifier to each orgunit such as Code, actually when you create your orgunit in dhis2 for the first time by importing them, you can set a code for each orgunit, maybe you can set the code field of each orgunit to the orgunit’s ID corresponding to your partners’ orgunits IDs, and When you import data you can tell dhis2 what to use as an identifier ID (the auto-generated one) or Code (the one your partners use) or even Name of orgunit.

I remember when I first used dhis2 I also wanted to take control of the generated id for somehow similar needs as yours, at the time I wasn’t yet aware of the options dhis2 is already providing for such needs, but it turned out later that I can use Code field to cover all my needs, either to import my data or to search for a particular orgunit using its code during data entry (web or mobile) (because in my case people in the field in the old system are familiar to lookup orgunits using some code). However, the Code field turned out to be all that I needed.

if you decided to use the code field in your case you may face some difficulties in creating your orgunits for the first time by importing them, especially when you have multiple levels, and each level’s orgunits are pointing to their parent by the auto-generated id, which you need in the import file next to each orgunit to point to its parent, and you only have Code at first to use as an identifier, if you faced this (maybe there is a different way) but I solved it by importing orgunits level by level and after importing each level I export it to use the DHIS auto-generated ids in the parent field of the next level’s orgunits, I used different automation tools to help me configure the import file of each level faster. You may need to do this for once and then use the Code field in all your needs, I may help you with that if you faced the same issues during the orgunits first import.

Dear @hamza,
Thank you s much for your feedback. I really appreciate your help to get through with my challenges. I dont quite understand the last sentence and how it might be applied to my own situation " You may need to do this for once and then use the Code field in all your needs, I may help you with that if you faced the same issues during the orgunits first import"
It seems to me from your message that there is a way around it but it is not very clear to me. Could it be that I will have to delete the org unit with the conflicting ID, lose all the data and then create a new one and start the data entry afresh?