Search code examples
artifactory

How to restore new Ubuntu artifactory-oss-7.27.9 installation from previous installation?


I built a new Ubuntu 22.04.2 (Jammy Jellyfish) server, replacing a dead Ubuntu 20.04.6 (Focal Fossa) server. The new server almost completely duplicates the old one, and has the practically the same configuration, including hostname, ip addresses, etc. Most filesystems were completely copied, in particular the /opt/jfrog directory, where open source artifactory (artifactory-oss-7.27.9) was installed. I renamed the old /opt/jfrog directory /opt/jfrog_bak. I then used apt to install a fresh version of artifactory-oss-7.27.9 from releases.jfrog.io. I started the fresh artifactory, changed the admin password, added a couple of users, then logged off and stopped it. Now I have two directories, /opt/jfrog, and /opt/jfrog_bak. I want to do a "System level" restore, as described on The help page System Import and Export

The very first instruction is to copy the master key. But no details are given. I can imagine several different sequences of

  • copying /opt/jfrog_bak/artifactory-oss-7.27.9/var/etc/security/master.key to /opt/jfrog/artifactory-oss-7.27.9/var/etc/security
  • (Re)Starting artifactory
  • Using the System Import & Export UI

What are the proper steps?

Also, what is the correct path to enter into the "Import System" field? As far as I know, all the data under /opt/jfrog_bak/artifactory-oss-7.27.9/var/data/artifactory/filestore is intact, and all the backups under /opt/jfrog_bak/artifactory-oss-7.27.9/var/backup should be good too.


Solution

  • Regrading the master.key, it should be copied to the same location/path in the new Artifactory installation before the import process:

    $JFROG_HOME/artifactory/var/etc/security/master.key
    

    For the import path, it should be the path to the location where the exported files are, may refer to this Knowledge-Base video for reference, in this case the migration is to the same environment.

    Note that in case the export process was done while the “Exclude Content” option checked, the binaries should be moved/copied to the new filestore location before the import process.

    So basically:

    1. System Export from the old Artifactory instance
    2. Install fresh Artifactory
    3. Copy the 'master.key' to the same location in the new Artifactory installation directory.
    4. Start (new) Artifactory
    5. Perform System Import