Up to this point, we've been talking about remote uploads, but what if a remote repository deletes a package? Say a given binary was cached in Artifactory before it was removed upstream, shouldn't it still be available to download? The answer is actually: No, because Artifactory is trying to mirror the remote site, the binary's metadata is being served directly from the upstream source. If the metadata says a particular package has been deleted, the client will receive a 404 Not Found error.
This said, the package hasn't truly been lost! To undelete a given package, it can be copied to a local Artifactory repository. There, Artifactory's local metadata calculation will list the package as available for download. However, as it is tedious to have to go to your UI and manually copy packages just to start using them again, we recommend that you:
- Download and install Artifactory's Remote Backup User Plugin (which must have a JSON configuration file present to function as intended).
- Create a local Artifactory repository of the same package type as the remote and configure the plugin to copy the remote cache to the local repository.
- Create a virtual repository and have remote clients use its URL instead.
Note: There are usually good reasons for deleting certain packages. Accordingly, there may be some risk in continuing to use a particular deprecated package. Additionally, package overwrites will never appear to the download client, as old local files will be served first.