17

I am trying to migrate nexus repo. How can I go about it, any pointers?

womble
  • 95,029
  • 29
  • 173
  • 228
zengr
  • 327
  • 1
  • 3
  • 15

3 Answers3

14

As stated in the doco the data storage and config. is separated from the application.

This way you can just copy both the application directory (Something like /opt/nexus-oss-webapp-X.Y.Z/) and your data directory (/opt/sonatype-work/) to a new server without any trouble.

I suspect the only setting that you'll need to change before trying to restart it is the repository URL which can be done by editing sonatype-work/nexus/conf/nexus.xml.

I just moved my repo from a machine to another, and upgraded it from 1.8.x to 1.9.0 at the same time without any trouble.

catbot
  • 103
  • 4
  • 2
    The link to the documentation has changed and is now: http://www.sonatype.com/books/nexus-book/reference/install-sect-upgrading.html – Hbf Apr 17 '12 at 11:22
  • @NicolasGuillaumin: So Users are also migrated automatically as well? – Gnanam Apr 24 '13 at 05:25
  • Not sure about users, I'm using LDAP so I don't have local users. I would assume that they would be stored in the data folder as well. – Nicolas Guillaumin Aug 05 '13 at 06:19
  • 1
    and now the link is http://books.sonatype.com/nexus-book/2.11/reference/upgrading.html – Jim Feb 06 '15 at 16:56
  • This post http://blog.sonatype.com/2010/01/how-to-backup-nexus-configuration-and-repository-artifacts/ has a section on which folders to include in a backup and which to omit which I found quite useful. – Ashutosh Jindal Nov 05 '15 at 13:32
1

One could use N3DR for migrating maven artifacts from an old to a new Nexus repository. Perhaps this section could be helpful:

"Clone" a Nexus3 repository

Suppose that one has created a new Nexus3 repository, e.g. NexusNEW and that one would like to copy the content of the old repository, e.g. NexusOLD, then these basic steps could be issued to "clone" NexusOLD:

n3dr backup -u -n \ -r cd download mv n3dr upload -u -n \ -r

030
  • 5,731
  • 12
  • 61
  • 107
1

For the most recent version of Nexus which creates a structure similar to this:

blobs  cache  db  elasticsearch  etc  generated-bundles  instances  javaprefs  kar  keystores  lock  log  orient  port  restore-from-backup  tmp

You can simply zip up both the blobs and the db directory and replace them from a fresh install of Nexus at the new location.

Don't forget to chown the files after unzipping to the appropriate permissions.

Make sure Nexus is stopped before you replace them. Once replaced, start Nexus back up it should start with no problems and start re-indexing.

Ian Newland
  • 111
  • 3