2

Using the UI, I can export Artifactory repositories. I'll be able to do it as mentioned in the documentation.

But what if I want to do it through a Rest API call or a jFrog CLI command?

TylerH
  • 20,799
  • 66
  • 75
  • 101
user2995458
  • 51
  • 1
  • 8

1 Answers1

1

JFrog has a CLI that can be used for many kinds of command line, automated or maintenance tasks. This CLI integrates great with CI/CD and with on demand tasks like downloading a file or a full repository.

Another option is to use the Artifactory REST API, which can be used to download a whole repository or folder from it. There are a zillion options for the REST API.

For system export, you need to use the Export System REST API call.

Eldad Assis
  • 10,464
  • 11
  • 52
  • 78
  • When I do it manually, I use this process to export the repositories. 1) choose all repository 2)providing the path to: /var/opt/jfrog/artifactory/export (server path) 3) exclude metadata, and then I click on export button on Artifactory UI. and I have searched the JFrog CLI commands, but I don't find any command to export the repository. Could you help me which command should I use in order to achieve above manual process? – user2995458 Jul 20 '21 at 22:05
  • Ah... so you mean to apply the system export option. In this case, you need to use the REST API for system export (https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-ExportSystem). I will add this to the answer. – Eldad Assis Jul 21 '21 at 05:48
  • I have installed docker Artifactory and when I am running this Rest API command to export the repository ** curl -u admin:password -X POST -H "Content-Type: application/json" --data @/tmp/export-settings.json http://localhost:8081/artifactory/api/export/system ** (Command end) Export-settings.json file contains these two lines- ** "exportPath" : "/tmp/", "includeMetadata" : true, ** question: - I am getting the successful message from curl command, But when I am looking into the /tmp/ directory, nothing is there. – user2995458 Jul 26 '21 at 14:13
  • Are you looking a the /tmp where the artifactory server? You probably have it in the Docker container's /tmp, which is not mounted from your host. – Eldad Assis Jul 26 '21 at 19:07
  • When I am exporting the artifacts it's downloading the pom.sha256,pom.md5, pom.sha1 and jar.sha256, jar.md5, jar.sha1. How to ignore these extra files, just want to download .jar and .pom. thats it. please suggest. – user2995458 Aug 04 '21 at 13:47
  • The export is for exporting *everything* in the repository. You can apply a filter after the export by simply finding and deleting all the *.sha256, *.md5 etc. – Eldad Assis Aug 04 '21 at 17:51