Change Base URL in Federated Repositories

Update the base URL on an active Federation in JFrog Artifactory and re-pair members.

Administrators can change the base URL or Federated base URL in an active Federated repository with remote members. Changing the base URL might be necessary, for example, if the network topology has changed.

Who can perform this task: Platform Administrators

🚧

Warning

Due to hardening the flow for changing the base URL, RTFS customers must complete an additional step. See the details in Generate New Tokens for Federation Members below.

🚧

Warning

This feature is available only when all Federation members are using version 7.55.1 or later.

Prerequisites:

  • All Federation members are running Artifactory 7.55.1 or later

This topic covers the following tasks:

Decide Which URL to Change

The steps required depend on whether the Federation uses the standard base URL or a special Federated base URL.

If a Federated base URL has been defined, the JPD publishes this address to all Federation members, who then use this address to access the Federated repository on the JPD instead of the standard base URL.

change-base-URL_diagrams_with-FedBaseURL.png change-base-URL_diagrams_without-FedBaseURL.png
Your scenarioProcedure
Change the standard base URLSee Change the base URL
Change the Federated base URLSee Change the Federated base URL

Change the Base URL

Change the standard base URL used by your JFrog Platform instance.

📘

Note

The custom Base URL is blocked on SaaS platforms and enabled on self-managed platforms.

To change the base URL:

  1. In the Administration module, click General Management > Settings.

  2. Enter a new custom base URL.

  3. Click Save.

    image__1_.png

  4. The next steps depend on the Federation service in use:

Source serviceTarget serviceSteps required
LegacyLegacyGenerate new pairing token, pair target to source, replace Base URL on target
LegacyRTFSGenerate new pairing token, pair target to source, replace Base URL on target
RTFSLegacyGenerate new pairing token, pair target to source
RTFSRTFSNo new pairing token required. Send the replaceUrl request on each other member (see Generate New Tokens for Federation Members), then continue to verification.
  1. Verify the functionality of the Federation (see After changing the base URL).
👍

Tip

You can also change the custom base URL using the Update Custom URL Base REST API.

Change the Federated Base URL

📘

Note

The custom Base URL is blocked on SaaS platforms and enabled on self-managed platforms.

If the Federation uses a Federated base URL, make changes directly using the Config Descriptor.

To change the Federated base URL:

  1. In the Administration module, click Artifactory Settings > Config Descriptor.

  2. Search the configuration file for a Federation base URL entry.

    Fed_base_URL_config-descriptor_edit.png

  3. Make the required changes to the Federation base URL and save your changes.

Generate New Tokens for Federation Members

After changing the base URL or Federated base URL, update the other Federation members. If either member uses the legacy Federation service, also generate a new pairing token and pair the source and target JPDs.

🚧

Warning

Always send the replaceUrl request in step 3 on each other Federation member after you change the base URL of a JPD. This applies when the JPD uses the legacy Federation service and when it uses the Artifactory Federation Service (RTFS). A Federation where both members use RTFS doesn't need a new pairing token, so skip steps 1 and 2, but it still needs the replaceUrl request. Generate a new pairing token when either member uses the legacy Federation service. After any change, verify the Federation status on every member.

To generate new tokens:

  1. Generate a new token from the source JPD using the Create Pairing Token Platform REST API. Skip this step when both members use RTFS.

  2. Pair the target JPD to the source JPD using the new token with the Initiate Pairing Platform REST API. Skip this step when both members use RTFS.

  3. On each other Federation member, send the following POST request. Use this step whether the JPD whose URL changed uses the legacy Federation service or RTFS. The request updates that member's record of the changed JPD. It doesn't change the base URL of the JPD that receives the request.

    api/federation/replaceUrl

{
    "oldBaseUrl": "http://<OLD_BASE_URL>/artifactory",
    "newBaseUrl": "http://<NEW_BASE_URL>/artifactory"
}

Where:

  • <OLD_BASE_URL>: The previous base URL of the JPD whose URL changed
  • <NEW_BASE_URL>: The new base URL of that same JPD. Don't set this to the base URL of the JPD that receives the request.

For example, JPD A changed from http://old-jpd.example.com/artifactory to http://new-jpd.example.com/artifactory. Send this body to each other member:

{
    "oldBaseUrl": "http://old-jpd.example.com/artifactory",
    "newBaseUrl": "http://new-jpd.example.com/artifactory"
}

Swap Base URLs Between Two JPDs

Use this procedure when two JPDs exchange base URLs, for example during disaster recovery failover.

To swap base URLs:

  1. Change the base URL on each JPD. See Change the Base URL or Change the Federated Base URL.
  2. On each JPD, send api/federation/replaceUrl for the other JPD, whether it uses the legacy Federation service or RTFS. Set oldBaseUrl to the other JPD's previous base URL and newBaseUrl to the other JPD's new base URL.
  3. Don't set newBaseUrl to the base URL of the JPD that receives the request.
  4. Don't remove Federation members to change or swap a base URL. Removing members recreates each Federated repository.
  5. Don't edit the database to update member URLs or Federation status.
  6. Verify the Federation. See After Changing the Base URL.

After Changing the Base URL

Test the functionality of the Federation after changing the base URL or Federated base URL.

To verify the Federation after changing the base URL:

  1. In the Administration module, click Platform Monitoring > Federation Status. If you see that the Federation is no longer in sync, there is a problem with the new configuration. This view is also available as the Federation Dashboard.
  2. (Optional) After verifying that all Federation members have synchronized successfully with the updated base URL, revoke the obsolete key for each remote JPD using the Revoke Token by ID REST API.
🚧

Warning

As a fallback, you can change the base URL more aggressively by canceling the Federation, changing the base URL, and then recreating the Federation. However, this has a huge impact on the system since it requires recreating each Federated repository from scratch.

Frequently Asked Questions

This section provides answers to frequently asked questions.

plusFAQs
Q: How do I know whether to change the standard base URL or the Federated base URL?

A: Check whether a Federated base URL has been defined for your Federation. If it has, the JPD publishes that address to Federation members instead of the standard base URL, so you must change the Federated base URL. Otherwise, change the standard base URL.

Q: Do I need to generate a new pairing token after changing the base URL?

A: It depends on the Federation service on each side. Any pairing that involves the legacy Federation service requires generating a new token and re-pairing the source and target JPDs. RTFS-to-RTFS Federations require no new pairing token, but you must still send the api/federation/replaceUrl request on each other member.

Q: How do I verify the Federation is healthy after changing the base URL?

A: Open Platform Monitoring > Federation Status (the Federation Dashboard) in the Administration module. If any member shows as out of sync, review your new base URL configuration before proceeding.

Q: What if Federation status shows Out of Sync for this JPD's own URL?

A: A mirror whose URL is this JPD's own base URL doesn't mean synchronization with the other members has stopped. Check that the other members show as in sync. Then contact JFrog Support to remove the stale mirror entry. Don't remove the Federation, and don't edit the database.

Q: What should I do if changing the base URL breaks the Federation?

A: Correct the member URL with api/federation/replaceUrl, then check pairing and connectivity. Don't edit the database. As a fallback, cancel the Federation, change the base URL, and recreate each Federated repository from scratch. This is a high-impact operation, so treat it as a last resort.

Related Topics


Did this page help you?