How to move existing repository to an organisation

I initially created the repository under the DockerHub as a user. And, now we moved to the Organisation under the same account. But, I can’t find an option to migrate the repositories from personal account to the Organisation?

Can anyone provide me the best way to migrate the existing repositories from personal account to the Organisation ?

Cheers,
M. Sharma

If you have existing organization, you can download your images from your user, add a new tag to each image to match the name of your organization and push those images to the organization. I don’t know any easier way to move all of your images for example by clicking on a “move” or “migrate” button.

If you are looking for a way to download all of your images from a repository, I think the following command would do the trick:

export OLD_REPOSITORY=yourusername/imagename
docker pull $OLD_REPOSITORY --all-tags

If you don’t have at least PRO subscription, you could probably reach the download rate limit

Then you can “rename”, in fact, add a new tag to the images:

export OLD_REPOSITORY=yourusername/imagename
export NEW_REPOSITORY=yourorganizationname/imagename
docker image ls $OLD_REPOSITORY --format '{{ .Repository }}:{{ .Tag }} {{ .Repository }}:{{ .Tag }}' | sed "s# .*:# $NEW_REPOSITORY:#" | xargs -L 1 -- docker tag

Then push them all

docker push $NEW_REPOSITORY --all-tags

Cool…thanks. This suggestions works for me, however not sure this is the best way to do or it.