How to migration nexus from one server to another

4,065 views
Skip to first unread message

ashish...@gmail.com

unread,
Aug 30, 2018, 2:06:26 PM8/30/18
to Nexus Users
I am currently running nexus2 on Server A. I have installed a fresh clean nexus on Server B. Both versions are the same. I know that I can migrate nexus data from Server A storage to Server B storage via rsync. However, how do I migrate the Nexus app configs (users, settings...) from Server A to Server B? 

Rich Seddon

unread,
Aug 30, 2018, 4:43:33 PM8/30/18
to Nexus Users
You need to copy the entire work directory (e.g, sonatype-work/nexus).  That will get everything (data and configuration).

If you decide to use rsync to do this copy, then do you can do it in two steps to minimize downtime. First use "rsync -avP <source> <dest>". This first copy can be done while the original server is running. After it completes, shut down the server and run "rsync -avP --del <source> <dest>". This will sync up any changes that happened since the first rsync completed.

If your original system has a slow disk you man need to use "ionice -c3 rsync", this will prevent rsync from consuming all disk bandwidth.

ashish...@gmail.com

unread,
Sep 16, 2018, 11:03:00 AM9/16/18
to Nexus Users
Is there a way to copy the data from the original server to the secondary server and keep them BOTH online? I want to start the secondary server and test it before I switch traffic to the new secondary server. I just want to make sure the secondary server does NOT impact anything in the TRUE original server.

Rich Seddon

unread,
Sep 16, 2018, 4:38:10 PM9/16/18
to Nexus Users
No, there currently isn't any way to do the whole copy while the original is online.  But as I mentioned previously, if you use rsync you can do most of it with the original running, and the second copy (done while it is shut down) should run quickly.

ashish...@gmail.com

unread,
Sep 19, 2018, 12:53:01 PM9/19/18
to Nexus Users
Thanks Rich!

Sorry to beat a dead horse here but would this be possible?


1. stop original Server A
2. rsync entire sonatype-work directory to Server B
3. Start Server A
4. Start Server B

Can I keep both of them online and independent of each other? My reasoning is that I want to 'test' server B before we do the final cut-over. So is there any data/config in the sonatype-work directory that 'points back to Server A' once it is copied over to Server B?

Rich Seddon

unread,
Sep 19, 2018, 1:49:32 PM9/19/18
to Nexus Users


Thanks Rich!
Sorry to beat a dead horse here but would this be possible?

1. stop original Server A
2. rsync entire sonatype-work directory to Server B
3. Start Server A
4. Start Server B
Can I keep both of them online and independent of each other? My reasoning is that I want to 'test' server B before we do the final cut-over. So is there any data/config in the sonatype-work directory that 'points back to Server A' once it is copied over to Server B?


Yes, that will work. 
On Thursday, August 30, 2018 at 1:06:26 PM UTC-5, ashish...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages