Convert Between Repository Types
Turn on Federation for a Local repository, and learn how existing Federated repositories behave.
Turn on Federation for a Local repository from the Multi-site tab. The repository type stays Local. This topic also covers conversion for an existing Federated repository and for a Build-Info repository.
Who can perform this task: Platform Administrators
Turn on Federation for a Local Repository
Federation and replication cannot both be active on the same Local repository. On a new Local repository, the Multi-site tab opens in Federation mode. If the repository already has replication and no Federation members, it opens in Replication mode. Switch to Federation removes the replication settings. To use replication on a repository that has Federation members, remove the members, then click Switch to Replication.
To federate a Local repository:
- In the Administration module, click Repositories.
- Create a Local repository, or open an existing Local repository.
- Open the Multi-site tab. Federation mode is already selected, unless the repository already has replication and no Federation members. In that case, click Switch to Federation.
- Add members, then save.
See Create a Federated Repository.
Create a Repository does not include Convert to Federated for this model. To federate a Local repository with the REST API, send rclass: "local" and a members list. See Create a Federated Repository.
Convert an Existing Federated Repository
Repositories already stored as rclass: "federated" keep that type, and they continue to work. The Convert Local Repository to a Federated Repository REST API is still available.
Warning
From Artifactory 7.179, the Convert Federated Repository to a Local Repository REST API is not supported. The request returns HTTP
400.
A Federated repository is a Local repository that has Federation members, so there is nothing to convert. To stop federating a repository, remove its members. Removing a member disconnects synchronization with that member. For the steps, see Add and Remove Federation Members. Check membership on the Federation Dashboard first.
Convert a Build-Info Repository to a Federated Repository
Build-Info repositories can be set as a Federation member. From Artifactory 7.35, you can convert an existing Build-Info repository to a Federated repository using the REST API.
Note
The Federated repository cannot be converted back to a local Build-Info repository.
Step 1: Convert the Build-Info Repository
Convert the Build-Info repository to a Federated repository:
POST /artifactory/api/federation/migrate/<BUILD_INFO_REPO_NAME>Where:
<BUILD_INFO_REPO_NAME>: The key of the Build-Info repository to convert
Sample input:
POST /artifactory/api/federation/migrate/artifactory-build-info
Migration finished successfully.Step 2: Add Members to the Build-Info Federation
After conversion, add members to the Federation using the Update Repository Configuration REST API. You can also manage membership through the Platform UI; see Add and Remove Federation Members.
{
"key": "projectKey-build-info",
"rclass" : "federated",
"members": [
{ "url": "http://<target-JPD>/artifactory/projectKey-build-info", "enabled":"true"},
{ "url": "http://<target-JPD>/artifactory/projectKey-build-info", "enabled":"true"}
]
}Frequently Asked Questions
This section provides answers to frequently asked questions.
FAQs
Q: Can I convert a Federated repository back to Local?
A: From Artifactory 7.179, the Convert Federated Repository to a Local Repository REST API isn't supported and returns HTTP 400. A Federated repository is a Local repository that has Federation members. To stop federating it, remove its members.
Q: What happens to my existing replication setup if I convert a repository to Federated?
A: Artifactory automatically deletes the replication definitions, since repository federations and replication can't coexist on the same repository.
Q: Can I convert a Federated repository back to a local Build-Info repository?
A: No. Once a Build-Info repository is converted to Federated, it can't be converted back to a local Build-Info repository.
Q: From which Artifactory version can I convert a Build-Info repository to Federated?
A: From Artifactory 7.35, you can convert an existing Build-Info repository to a Federated repository using the REST API.
Related Topics
Updated 4 days ago
