The Repository - Export assets task will export all the content from a selected repository into a directory in your server. The content of this export directory can be imported to another Sonatype Nexus Repository instance using the Repository - Import external files task.
Only available in Sonatype Nexus Repository Pro. Interested in a free trial? Start here.
If you plan to import your exported content to another Sonatype Nexus Repository 3 instance, both the source and target Sonatype Nexus Repository 3 instances must be using the same version. You will not be able to import files from an older or newer Sonatype Nexus Repository 3 version. However, you can import files from the latest Sonatype Nexus Repository 2 version in order to upgrade.
Create a new task of type Repository - Export assets and you will be presented with the configuration options listed below:
A number of the fields on this form are common to all tasks and described in the main Tasks topic. The export-specific fields are as follows:
Source repository - The repository to export content from. This list will only be populated with repositories of the supported formats (see format list below).
Target directory - The directory to export content into.
Threshold (in days) of unused assets to include NEW IN 3.54.0 - You would usually use this field to export unused assets that you'd like to archive. When set, Sonatype Nexus Repository will only export assets that have not been updated or downloaded in the provided number of days (e.g., set to "30" to export assets that have not been updated or downloaded for 30 days). If left blank or set to "0," the export will include all assets.
Note that Sonatype Nexus Repository will use this threshold to identify and export assets, not components, which can comprise multiple assets. This is different from a cleanup policy, which looks at whether an entire component or any of its parts have been used. See Components, Repositories, and Repository Formats to better understand the difference between components and assets.
If you wish to delete unused assets after exporting them, you will need to identify and use the paths from the export to delete the content from the primary server.
The target directory must be writable by the user running Sonatype Nexus Repository. The export history is stored in the target directory to enable incremental exports.
The task can be configured to run manually or on a schedule fitting your needs. And when the task runs, it generates a
.nexus directory inside of the target directory, that contains some metadata we use for future exports, so that content won't be exported multiple times if the task is run more than once. This will allow you to keep exporting content into this directory, and the next time the export task runs, only the newer content will be exported.
As the export is being processed, every single file that is exported will be logged to a task log (a new task log is created each time a task runs), along with any errors that may have occurred. If an error occurs with any particular asset, we will simply log that fact, then continue on exporting the rest of the content.
Currently, content can be exported from repositories of any format listed below: