In this article, we will briefly discuss the migration steps involved Nexus to Artifactory transfer using the Repository Export (in Nexus) and Repository Import (in Artifactory) method.
This strategy of migration will be useful when the environment has constraints in using the JFrog migrator tool (script). The migrator tool involves the utilization of Docker client and making changes to nexus.properties file in the backend server.
Repository Export (On the Nexus Side):
- In the Nexus UI navigate to Administration | Tasks | Create Tasks and choose “Repository- Export Assets”.
- Provide the task name and under Target directory provide /tmp/ folder as the path.
- Set Task frequency as manual and save the task configurations.
- Under the tasks tab run the created task, this will initiate the export task.
- In the Nexus backend server under /tmp/ directory the exported repository can be found.(Note: The process might take some time for the entire content to be exported onto the target directory).
- Create a zip archive for the content of the repository by using the command below.
zip -r filename.zip nse
Here nse is the repository name I have used. - Use SCP command on the archive zip directory from the Nexus server to copy it to Artifactory server’s /tmp/ directory.
Repository Import (On the Artifactory Side):
- Unzip the copied zip archive in the Artifactory instance.
- In the Artifactory UI create a local repository (Administration | Repositories |
- Create a Repository | Local) of the same type as that of the repository we are importing. .
- Once the repository is created, navigate to Administration | Artifactory Settings | Repository Import & Export.
- Under “Import Repository from Path”, select the target repository and provide the Import Path on Artifactory Server by using the browse option.
- Select the Output Verbose log and then click on the Import button (Certain bad pom files and md5, sha1sum, and sha256sum files might fail to be imported with error message pop-up; however, artifacts should be imported without any issue).
- Now check whether Artifacts are successfully imported to the target repository.
Follow the above steps for all the repositories that are to be imported one after the other by creating new tasks in Nexus.