I have a need to migrate the structure of a repo on an Artifactory Enterprise Plus 7.49.6 server, splitting it up into a few smaller repos. For a transition period, I want to replicate the old repo to the new repos, using exclude patterns to select what goes into each destination repo. Artifactory's in-built replication functionality seems like exactly what I'd need for this, except that it's always described in connection with replication to a different Artifactory server. A little testing with some toy example repos suggests that this replication does also work to a destination repo on the same local server, with exclude patterns and all. But I wonder if this is a supported or recommended usage mode? I've never seen it mentioned in any docs, which surprises me, since I assume that others would find it useful in some circumstances.
2 Answers
I was curious also so I also set up a test locally, and can confirm this does work. I have 2 local repositories on the same server and I have set up replication from one to the other. It works as expected.
I don't see any reason why it shouldn't and I think you are good to go here.

- 11
- 2
There is a feature called Copy/Move contents from one repository to another repository. You can set the desired exclude pattern on the destination1 repository and run the above operation. It excludes the specific pattern and copies/moves the remaining artifacts. For example, I have created 2 repositories, gaja1 and gaja2. I have added the below exclude pattern on gaja2 (this will be my destination repository)
com/test/**
I performed a copy operation from source to destination. It copies everything other than the patterns that I have set. copy operation Gives the below information while performing the operation.
The repository 'gaja2' rejected the resolution of artifact in path 'com/test' due to a conflict with its include/exclude patterns.
Cannot create/override the path 'gaja2:com/test'. Skipping this path and all its children.

- 445
- 1
- 3
- 6
-
I probably should have clarified, I need this to be an ongoing “live” replication, over a time period. Your copy approach (e.g., using the JFrog CLI) would work if I set it up in Jenkins or something, to run on a schedule, or on the basis of a webhook trigger from Artifactory. But I’m hoping that Artifactory’s built-in replication functionality *can* indeed be used for this. That would save a lot of bother. – jor Jul 17 '23 at 07:24
-
That's a strange requirement. We will end up in having duplicates. Meaning same entries in 2 different repositories. If you want to segregate the existing artifacts in a repository to different repositires it would be a kind of usecase. But if we keep in having in main repository and in a sub repository, that might not a good usecase. Neverthless, it is possible to achieve using the bleow plugin. https://github.com/jfrog/artifactory-user-plugins/tree/master/storage/remoteBackup The combination of plugin on existing repository and exclude patterns on new repositories should help you. – Gajapathi Kimidi Jul 18 '23 at 10:11