Import and Export
JFrog Artifactory supports import and export at two levels: individual repositories and the full system, including configuration, security, and stored data.
Artifactory supports the import and export of data at two levels:
- Repository level: Artifactory can export and import data and metadata stored in a repository. This is useful when moving store data, including its metadata between repositories and for batch population of a repository.
- System level: Artifactory can export and import the whole Artifactory server: configuration, security information, stored data and metadata. The format used is identical to the System Backup format. This is useful when manually running backups and for migrating and restoring a complete Artifactory instance (as an alternative to using database-level backup and restore).
Repositories Import and Export
Note
Importing repositories is supported for all users but exporting repositories is only available for non-SaaS users.
To access import and export of repositories, in the Administration module, select Artifactory > Import & Export > Repositories.
Export Repositories
Exporting repositories enables you to export data and metadata stored in that repository. You may need to do this as part of moving store and metadata between repositories and for batch population of a repository.
To export a repository:
-
In the navigation panel on the left-hand side of the screen, click Administration .
-
In the General section of this screen, click Settings. The Artifactory General Settings screen appears.
-
In the Import & Export pane, click Repositories. The Repositories Import and Export dialog appears.
-
Configure Export parameters, as shown below, then click Export. The file is exported.
| Field | Description |
|---|---|
| Target Local Repository | You can specify a single repository to export or All Repositories |
| Export Path on Server | The export target directory on your server |
| Exclude Metadata | When set, repository metadata is excluded from the export. (Maven 2 metadata is unaffected by this setting) |
| Create .m2 Compatible Export | When set, includes Maven 2 repository metadata and checksum files as part of the export |
| Output Verbose Log | When set, lowers the log level to "debug" and redirects the output from the standard log to the import-export log. You can monitor the log in the System Logs page. |
Import Repositories
You can import repositories previously exported as described in Export Repositories. This is typically done when moving store and metadata between repositories and as part of batch operations.
Note
- Imported repositories have a required layout. For information on the required layout see Import Repository Layout
- To disable the system import option, set the artifactory.system.import.enabled property in the
artifactory.system.properties fileto false- To view or configure these settings you need Administrative privileges. If you do not see the Administration option at the top of the JFrog instance, contact your JFrog administrator for assistance.
- To access import and export of your entire system, in the Administration module, select Import & Export | System
To import a previously exported repository:
-
In the Adminstration workspace, under Artifactory Settings, click Repository Import/Export. The Import Repositories screen appears.
All users can import repositories from by zipping a repository and uploading it to Artifactory. Additionally, Self-Hosted users have the option of importing from a server-side folder.
-
Complete the details as listed below, then click Import. The repository content is imported.
| Field | Description |
|---|---|
| Target Local Repository | You can specify a single repository to import, or All Repositories. The repository layout should be different depending on your selection. Please refer to Import Layout. |
| Server Path for Import | The import source directory on your server. Note: This option is only available for Self-Hosted users. |
| Repository Zip File | Applicable when importing repo from zip file. Drop the repository zip file |
| Exclude Metadata | When set, repository metadata are excluded from the import |
| Output Verbose Log | When set, lowers the log level to "debug" and redirects the output from the standard log to the import-export log. You can monitor the log in the System Logs page. |
Don't exclude metadata for Docker
To work with a Docker repository, it must have its metadata intact. Therefore, when importing to/exporting from a Docker repository make sure that Exclude Metadata is not checked.
Importing into a Remote Repository Cache
You can take advantage of remote repositories you have already downloaded to your local environment, and import them directly into a local repository.
For example, you can take your local Maven repository (usually located under ~/.m2) and upload it into Artifactory so that all the artifacts you have already downloaded are now available on the server.
Import Repository Layout
This topic describes the required layout for repositories when importing them into the JDP. For more information on importing repositories, see Import Repositories.
An imported repository needs to be formatted using a Maven 2 repository layout.
When importing a single repository, the file structure within the import folder (or zip file) should be as follows:
IMPORT_FOLDER/ZIP_FILE
|
|--LIB_DIR_1When importing all repositories, the file structure within the import folder should be as follows:
IMPORT_FOLDER/ZIP_FILE
|
|--REPOSITORY_NAME_DIR_1
| |
| |--LIB_DIR_1Note
When importing all repositories, you need to ensure that the names of the directories representing the repositories in the archive match the names of the target repositories in Artifactory.
System Import and Export
Artifactory maintains all security entities (users, groups, permissions and access tokens) when doing a system import.
Note
The System Import and Export feature is not available for Artifactory Cloud users.
Copy the $JFROG_HOME Master Key
Copying the $JFROG_HOME/artifactory/var/etc/security/master.key is a critical step in the import process - for both single node and HA imports. The master.key is an AES secret key (128 or 256 bit) that is used by Artifactory for encrypting and decrypting the shared data in the database and is, therefore, required for the import process.
Warning
We do not recommend that you import and export between different versions of Artifactory.
Tip
It is very important that the import files on the server should be readable and owned by the same user running the Artifactory process.
Note
Although we do not recommend it, when you import from a 6.x export into a 7.x installation, you need to replace the
logback.xmlin the export with a 7.xlogback.xmlotherwise logging will break during import.
To access import and export of your entire system, in the Administration module, select Artifactory > Import & Export > System. The System Import & Export dialog displays the following fields:
Field | Description |
|---|---|
Export Path on Server | The target directory for the exported files. You may browse your file system to select the directory |
Exclude Content | Export: When set, repository binaries are excluded from the export. Import: When set, binaries and metadata are excluded from the import. Only builds and configuration files are imported. |
Exclude Metadata | When set, repository metadata are excluded from the import/export. (Maven 2 metadata is unaffected by this setting) Docker repositories must have metadata. If you have Docker repositories, clear the Exclude Metadata option. |
Create .m2 Compatible Export | \When set, includes Maven 2 repository metadata and checksum files as part of the export |
Create a Zip Archive (Slow and CPU Intensive!) | When set, creates and exports to a zip archive. Note If there is failure when you import a zip file, extract the zip file to a folder and select the extracted folder for import. |
Output Verbose Log | When set, lowers the log level to "debug" and redirects the output from the standard log to the View the log at Administration > Monitoring > Artifactory Logs. |
The source/target of the import/export operations are folders (Zip archives are not recommended) on the Artifactory server. You can use the built-in Server File System Browser to select server-side source/target folders.
Note
Importing or exporting a large amount of data may be time consuming. During the import/export operation you can browse away from the page and sample the Service Logs to monitor progress.
System Import and Export for an HA Cluster
When performing a system export and subsequent import for an HA cluster, you need to follow the procedure below to ensure that the cluster is able to correctly synchronize its nodes.
Note
When importing from a 6.x export into a 7.x installation, you will need to replace the
logback.xmlin the export with a 7.xlogback.xml, otherwise logging will break during import.
-
Perform a normal system export from the source cluster as described above.
-
In the target cluster, keep only one node running, and perform a graceful shutdown to all the rest of the nodes.
-
Perform normal system import to the target cluster (which now has only one node running) as described above.
-
For Artifactory versions below 7.12.0, perform a graceful shutdown of the running node and then restart it.
-
For each additional node:
-
Delete the following folders:
$JFROG_HOME/artifactory/var/etc/access$JFROG_HOME/artifactory/var/etc/security$JFROG_HOME/artifactory/var/etc/artifactory/ui$JFROG_HOME/artifactory/var/etc/artifactory/plugins
-
Copy the
$JFROG_HOME/artifactory/var/etc/security/master.keyfrom the running node to the additional nodes. -
Start up the additional nodes.
-
Once you have completed the import, we recommend verifying that your HA cluster is up and running by checking whether all the nodes and services are online. For more information on viewing service status, see Monitoring Service Statuses.
Note
After an import, the services of Distribution, Xray, Pipelines, and Insight should be restarted.
System Import and Active Repository Federations
If you perform a system import on an Artifactory instance that has active repository Federations, all remote members are removed from the Federation automatically. This is done to ensure the import can be completed successfully.
After the import is complete, perform the procedure described below to recover the Federation.
To recover a repository Federation after a system import:
-
Re-establish trust with each remote member. For more information, see Setup Prerequisites for Federated Repositories.
-
Go to the Artifactory instance (JPD) of each remote member, remove the imported member from the Federation, and then add it back again.
Adding the imported member back to the Federation will trigger a Full Sync for recovering the files.
Updated 18 days ago
