CreatedBy "errors" in Importing Metadata to another instance

I’m trying to understand the value of erroring out imports which have “createdBy” usernames that don’t exist in the instance being imported into. When exporting a metadataDependencyPull of a program from 1 server into another, I am commonly given multitudes of errors that the createdBy username doesn’t exist in the target server, and thus cannot be imported.

I suppose I’d prefer, if this is an “errorable offense” to import something, to have the ability to omit “createdBy” in the file that I’m downloading, vs. having to find/remove all instances in the jsons; curious if this is something others have come across and any efficient ways they’ve dealt with it? Thanks!

Hi @Matthew_Boddie

I downloaded the JSON file using the same steps you mentioned and opened it on Visual Studio Code, I tried to delete all the “createdBy” objects using regex code ,"createdBy":\{[^}]*\},

I tried to import it but I’m getting some errors so I undid the changes and then when I tried to import it as is it didn’t work but it didn’t mention the issues you mentioned. Would you please share the steps to reproduce the issue so I can test more?


1 Like

Hi @Gassim thanks for having a look here

Mine was to pull a program from our server and push it directly into play (where our users don’t exist). I can send you our metadata for testing, but as a screenshot of how it appears:

This particular program is showing createdBy errors for dataElement, program, programIndicator, programStage, and optionSet (1638 errors in total coming in through the import/export app)

Thank you for the regex, this is nice!

1 Like

Hi @Matthew_Boddie

I did a dry run and this is what I’m getting:

You can see the settings I used:

Interesting! I selected this and got similar results. Toggling this off, and the errors appear.

I might argue that sharing and access settings should be distinct from createdBy distinction, as I can’t think that has an effect on access/sharing. I could also envision a world where I’d like to keep userGroup access settings, even though the createdBy user is still erroneous. Thoughts?

1 Like

Pretty sure the key here is “atomic mode”. If this is set to “Import”, then the objects will attempt to be imported even if the object in the incoming (meta)data does not exist. In this case, the “createdBy” value does not exist in the target system.


Interesting, thanks @jason ! I’ll have a look at that.

1 Like