How to restore content from trashcan in Artifactory? [Video]

Eran Blumenthal
2021-02-02 14:37

Restoring deleted/overwritten artifacts in Artifactory

 

Video Transcription

Hello and good day. My name is Ron and I’m from the JFrog support team. In this short video, I will show how to restore content from the trashcan in Artifactory.

Let’s start. First, we will go into the Artifact browser and we will overwrite one file. Okay. Let us overwrite this file. As you can see, this file was uploaded by myself. Okay. Next, let us delete another file.

And see that it have reached the trashcan. Okay. So we have the overwritten file and we have the deleted file. Now all we need to do in order to restore these files is either to restore the entire folder that was hosting them or restore each individual file.

In this case, I can restore both of them because in this context it makes sense. So I restore. When I restore, I can actually restore to a different location from the one that I actually deleted or overwritten on. So I can move it to any other repository in Artifactory.

In this case, again, we will keep the same thing that we delete it from. So now we see the file was returned and that we see that we have a different file that was deployed by another entity. This is the original file.

Now what I want to do is to delete another file, but to restore it from the command line, through the REST API. So we deleted the file and now let’s see how we restore it from the command line. So in order to restore from the command line, I’m going to use cURL with the Artifactory REST API. So please note that this refers to API/trash/restore. And after that, I’m providing the path to the file in the trashcan and then the destination. So even through the REST API, I have the same option to restore to a different location than the one that I deleted the file from.

So let’s go, I’ll put my password. And the response is it successfully restored trash items. Now let’s see this in the UI. Let me refresh. Then here we go, the file was restored and it was removed from the trashcan.

That’s it. Thank you very much. That was my video on restoring from the Artifactory trashcan. Thanks for watching. And I hope you have enjoyed, feel free to leave your comments, feedbacks or questions in the comments section below.