Omero CLI upload vs. import

This started as a question, and I think ended up with an answer. Figured I would post anyway, mainly to document my experience, maybe it is handy for the developers or another user.

I am using a local docker version of OMERO CLI to upload to a remote OMERO server.

docker run --rm -v /media:/tmp --entrypoint=/opt/omero/server/OMERO.server/bin/omero openmicroscopy/omero-server -s example.com -u exampleuser upload /tmp/file.tif

After running the command I got the message:

OriginalFile:159
This module is deprecated as of OMERO 5.5.0. Use the module available from https://pypi.org/project/omero-upload/ instead.

I then realised that I should follow the instructions here:
https://omero-guides.readthedocs.io/en/latest/upload/docs/import-cli.html
A command similar to:

docker run --rm -v /media:/tmp --entrypoint=/opt/omero/server/OMERO.server/bin/omero -s example.com -u exampleuser -g exampleusergroup import -d 4 /tmp/file.tif

worked perfectly.

I guess that marking the command as upload (deprecated) might be handy for new people to know that they need to look elsewhere, since it is at the top level of commands that you can see.

Hi,
the deprecation warning means that the ‘upload’ functionality will be removed from the core CLI, because it is available as separate CLI plugin. It does not mean that upload is replaced by import. These are two different things. If you want to import images, import is and always has been the command to use, as you found out. Whereas upload is used to upload generic files, for example in order to attach them to images, datasets, etc. A file uploaded like that won’t be interpreted as image by OMERO, it is simply just uploaded. Note: In order to attach it some more steps are necessary, see https://docs.openmicroscopy.org/omero/5.6.0/users/cli/containers-annotations.html#creating-and-attaching-annotations
Kind Regards,
Dominik

1 Like