Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nexus 3 backup via command line?

In Nexus 3 backup procedure has changed.

In Nexus 2 recommended was to run a OS scheduled task / cron job to rsync some directories to a backup location.

In Nexus 3 the recommended way seems to be to create to schedule a predefined Nexus Task Export configuration & metadata for backup Task. And then also create a cron job to backup what gets exported with this task.

Is it still possible in Nexus 3 to do a old style backup? Shutdown the server and backup certain directories? And then for restore just put everything back? Will that work?

Or use a command line to run this task?

The way this is done in Nexus 3 does not seem to be thought through very well. You need to do a lot more to do what could be done with a single cron job in Nexus 2:

  1. Create a scheduled task to export data.
  2. Create a cron job to backup exported data.
  3. Make sure that scheduled task runs and finished before the cron job.

See for example https://help.sonatype.com/display/NXRM3/Restore+Exported+Databases

See also Nexus Repository 3 backup

like image 956
onknows Avatar asked Mar 14 '18 07:03

onknows


People also ask

Where is Nexus configuration stored?

nexus/conf — All the nexus configuration files are stored here, this includes repository configuration, security configuration, and log configuration. Although you can recreate them in theory, you'd hate to lose them — it takes time to recreate them, so, back up this folder.

What is sonatype work directory?

The Sonatype Work directory sonatype-work is created as a sibling to the nexus application directory, and the location of this directory can be configured via the nexus. properties file which is described in Configuration Directory. This directory contains a log of all IP addresses accessing the repository manager.

Can Nexus 2 be migrated to Nexus 3 True or false?

Yes it supports this.

Is Nexus repository free?

Nexus Repository Manager OSS is a free-to-use artifact repository.


1 Answers

If you back up the entire data (sonatype-work) directory this should work as you wish. However, since the data directory is large and has many moving parts, it is safer to use the task, otherwise you may get copies of things in motion which could then corrupt and your backup would not work. The copy of the work directory as far as I know is only recommended for servers that are down, which isn't an option for many bigger companies.

like image 165
joedragons Avatar answered Sep 17 '22 16:09

joedragons