Notes for Nexus Audit Info Migration

JBoss.org has been using a custom audit plugin in Nexus since it was first rolled out last year.  The current version of Nexus 1.9.0.2 now has all required audit information by default.  The old audit information needs to be migrated to the standard Nexus XML format.  That way the info will be available to the default Nexus UI.  This page documents some notes about the migration process to move audit info from the custom file format to the standard Nexus audit file format.

 

A perl script was created to parse the old Nexus audit files and insert the data into the default Nexus XML files.  This script requires Perl 5 is installed on the system along with the following modules:

 

perl-TimeDate - yum install perl-TimeDate

 

Running the Script

Note: Nexus does not need to be stopped while running this script.  The script will not interfere with Nexus.

 

perl migrate_audit_info.pl [sonatype_work_dir]

 

The script will extract audit data from the existing audit.json files and insert this data into the Nexus attributes files where possible.

When the data migration is finished, the script will move all audit.json files to a temporary location in [sonatype_work_dir]/temp

A log file is generated in the location [sonatype_work_dir]/temp/output.log

 

Types of Files in the Repo

Files from old JBoss Repo

These are files that were migrated from the old JBoss repository.  This is the only case in which the audit info needs to be migrated.

In these cases, the request.user field will be blank and the "owner" will contain a valid username.  The "owner" and "captured-on" info is migrated to the attributes file.

Check: attributes does not contain username, audit.json file contains username

 

Files Staged and released after migration to Nexus

Nexus attributes files already contain correct user and timestamp info.  In this case, the attribute already contains the username.  No modification is necessary, and the audit.json files can be removed.

Check: attributes contains username

 

Files Manually uploaded to Nexus

Neither the audit or the attirubute file contains correct user info.  The attribute file already contains the corret timestamp, so no modification is necessary.

Check: attributes does not contain username, audit file does not contain username.

 

.