Import a JFrog CLI Server Configuration
Import a JFrog CLI server configuration from a Config Token on a new machine.
jf config import creates or updates a local server entry from a Config Token produced by jf config export. Import helps you replicate a colleague's configuration, or a configuration from continuous integration and delivery (CI/CD), on a new machine without re-entering every flag by hand.
Prerequisites. JFrog CLI must be installed and available as jf. You need a Config Token from an existing configuration. Generate one with jf config export as described in Export a JFrog CLI server configuration.
This topic covers:
Synopsis
jf config import <config-token>Aliases: jf c im
Where:
<config-token>: The full base64 token string printed byjf config export.
Arguments
The following table describes command arguments.
| Argument | Required | Description |
|---|---|---|
config-token | Yes | The Config Token from jf config export |
Examples
Import a Configuration
To import a server configuration from a Config Token:
-
On a machine that already has the desired configuration, export a token. For more information, see Export a JFrog CLI server configuration.
jf config export <server-id>Where:
<server-id>: The server ID to export.
-
On the target machine, run:
jf config import <config-token>Where:
<config-token>: Paste the complete token from the export command's output. Do not truncate or add quotes unless your shell requires them.
-
Confirm success. Expected output:
[Info] Importing server ID 'my-server'
After a successful import, jf config show lists the new server.
What Is a Config Token?
A Config Token is a base64-encoded string produced by jf config export. It contains the server URL, authentication credentials, and other settings that were configured on the source server, encoded in a portable format. You can share it across machines or team members to quickly replicate a server configuration.
Note
The token only captures what was present in the source configuration. If the source server was added without a URL or credentials (for example, a stub entry), the token only contains the server ID. Importing such a token creates an incomplete server entry. Use
jf config editorjf config addto fill in the missing details after importing.
Important Notes
- Security. Config Tokens contain sensitive credentials (access tokens or passwords). Treat them like passwords. Do not log them, commit them to source control, or share them over unencrypted channels.
- Overwrites existing servers without confirmation. If a server with the same server ID already exists in your local configuration, the JFrog CLI silently replaces it with the imported token. There is no prompt. Ensure you want to overwrite before you run the command.
- Default server flag. The token does not carry the
isDefaultvalue from the source. After import, if this is the only server in your local configuration, the JFrog CLI sets it as the default. If you already have other servers and the imported server ID is new, the imported entry is not made the default. However, if the imported server ID matches an existing entry that was already your default, the import preserves that entry's default status. It stays the default even though the flag isn't in the token. Runjf config use <server-id>to explicitly control which server is active. - One-time import. The token does not expire, but credentials inside it might. If the access token in the Config Token has expired, the imported configuration will not work. You need to update it with
jf config editor re-add withjf config add. - Encryption. If the source configuration was encrypted with
JFROG_CLI_ENCRYPTION_KEY, the Config Token contains the encrypted values. The importing machine does not need the encryption key to import, but it stores the configuration in its own encryption context.
Next Steps
To verify the server was added after import:
-
Run:
jf config show -
To set the imported server as your default, run:
jf config use <server-id>Where:
<server-id>: The ID shown in the import success message orjf config show.
For example:
jf config use my-server
Troubleshooting
illegal base64 data at input byte N
The token string is not valid base64. For example, it was truncated when copied, characters were altered, or extra text (such as shell output) was pasted in alongside it. Copy the complete, unmodified token produced by jf config export and retry.
invalid character '…' looking for beginning of value
The string decoded as base64 but the result is not valid JSON, so it isn't a real Config Token. Re-export a fresh token with jf config export <server-id> and try the import again.
Wrong number of arguments (N).
jf config import requires exactly one argument: the Config Token. Running it with no arguments or with more than one argument prints this error (along with the command's help text) and exits with a non-zero code.
Imported server has no URL or credentials
The source server was exported without a URL or credentials configured. The token only contains the server ID. Use jf config edit <server-id> to add the missing URL and credentials.
Credentials in the imported configuration no longer work
The access token embedded in the Config Token may have expired. Update the configuration with jf config edit <server-id> or remove and re-add the server with jf config add.
Frequently Asked Questions
This section provides answers to frequently asked questions.
FAQs
Q: How do I import a JFrog CLI server configuration?
A: Run jf config import <config-token>, pasting the complete token produced by jf config export. For the full syntax, see Import a Configuration.
Q: What happens if I import a token for a server ID that already exists?
A: The JFrog CLI silently overwrites the existing server entry with the imported token. There is no confirmation prompt, so confirm you want to overwrite before you run the command.
Q: What do I need before I can import a configuration?
A: You need JFrog CLI installed and a Config Token generated with jf config export. See Export a JFrog CLI server configuration.
Q: Can I use an imported server right away?
A: Only if it's the only server in your configuration, since the JFrog CLI then sets it as the default automatically. Otherwise, run jf config use <server-id> after import. See Next Steps.
Q: What's the difference between an incomplete token and an expired one?
A: An incomplete token only contains a server ID because the source server had no URL or credentials. An expired token imports fine but its embedded access token no longer authenticates, so update it with jf config edit.
Related Topics
Updated 2 days ago
What’s Next
After importing, set the server as your default with jf config use.
