'How to move artifacts in artifactory?

Can someone help me find a way to copy an artifact from one artifactory location to another location, inside the same repository. I understand there are ways to move artifactory between repositories, but my requirement is to move x1 to module-2 as in below folder structure.

+
+- repository
   +- com
      +- module-1
      |  +- x1
      +- module-2
         +- x2

Thank you very much in advance.



Solution 1:[1]

The easiest way is using the REST API. Here's an example:

curl -v -X -d "" POST -uusername "http://host:port/artifactory/api/move/repository/com/module-1/x1?to=/repository/com/module2/x1"

Solution 2:[2]

You can also use the JFrog CLI. The usage is something like

jfrog rt move repository/com/module-1/x1 repository/com/module2/x1

The cli is especially useful when you want to move multiple files.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TechDog
Solution 2 papanito