Migration to Postgres - Blob-count zero

Hello!
We are migrating the database to postgres. In one of our testinstance we configured everything as in the documentation and ran the migration tools. Run was successful but after restarting Nexus with postgres configuration the metrics for blobs are lost, see screenshot. For “docker-main-test” it should be 30.

We used the latest migration tool with this command:

java -Xmx4G -Xms4G -XX:MaxDirectMemorySize=4014M \
-jar /tmp/nexus-db-migrator-3.42.0-02.jar \
--migration_type=postgres --content_migration=true \
--db_url="jdbc:postgresql://postgreshost:5432/nexusdbtest?user=*****&password=*****"

Log from migration script:

06:31:02 [main] INFO  c.s.n.d.migrator.MigratorApplication - Force parameter wasn't found. Setting it to false by default.
06:31:02 [main] INFO  c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------
06:31:02 [main] INFO  c.s.n.d.migrator.MigratorApplication - Java version: Red Hat, Inc. 1.8.0_345
06:31:02 [main] INFO  c.s.n.d.migrator.MigratorApplication - JVM arguments: -Xmx4G -Xms4G -XX:MaxDirectMemorySize=4014M
06:31:02 [main] INFO  c.s.n.d.migrator.MigratorApplication - Migrator arguments: --migration_type=postgres --content_migration=true --db_url=jdbc:postgresql://postgreshost:5432/****?user=****&password=**** --force=false
06:31:02 [main] INFO  c.s.n.d.migrator.MigratorApplication - ------------------------------------------------------------
06:31:02 [main] INFO  c.s.n.d.migrator.MigratorApplication - Starting MigratorApplication v3.42.0-02 using Java 1.8.0_345 on f2edb7f38389 with PID 65 (/tmp/nexus-db-migrator-3.42.0-02.jar started by nexus in /nexus-data/db)
06:31:02 [main] INFO  c.s.n.d.migrator.MigratorApplication - No active profile set, falling back to 1 default profile: "default"
06:31:05 [main] INFO  o.s.b.c.r.s.JobRepositoryFactoryBean - No database type set, using meta data indicating: POSTGRES
06:31:05 [main] INFO  c.s.n.d.migrator.MigratorApplication - Started MigratorApplication in 3.394 seconds (JVM running for 6.153)
06:31:05 [main] INFO  o.s.b.a.b.JobLauncherApplicationRunner - Running default command line with: [--migration_type=postgres, --content_migration=true, --db_url=jdbc:postgresql://postgreshost:5432/nexusdbtest?user=****&password=****, --force=false]
06:31:05 [main] INFO  c.s.n.d.m.validator.PathValidator - Validating Orient directory: /nexus-data/db
06:31:05 [main] INFO  c.s.n.d.m.validator.PathValidator - Validating Orient directory: /nexus-data/db
06:31:05 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - Migration job started at Tue Nov 29 06:31:05 GMT 2022
06:31:05 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [startHealthCheckDeciderStep]
06:31:05 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [startHealthCheckDeciderStep] executed in 22ms
06:31:05 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [exportFilesStep]
06:31:05 [main] INFO  c.s.n.d.m.export.JsonFilesExporter - Export may take several minutes depending on the amount of data
06:31:07 [main] INFO  c.s.n.d.m.export.JsonFilesExporter - Exported config JSON file path /tmp/export_json-241476961462744889/config
06:31:07 [main] INFO  c.s.n.d.m.export.JsonFilesExporter - Exported security JSON file path /tmp/export_json-241476961462744889/security
06:31:08 [main] INFO  c.s.n.d.m.export.JsonFilesExporter - Exported component JSON file path /tmp/export_json-241476961462744889/component
06:31:08 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [exportFilesStep] executed in 3s158ms
06:31:08 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [readFileStep]
06:31:09 [main] INFO  c.s.n.db.migrator.reader.FileReader - Current migration type is postgres.
06:31:09 [main] INFO  c.s.n.db.migrator.reader.FileReader - Total number of config and security records to be processed = 65
06:31:09 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [readFileStep] executed in 199ms
06:31:09 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [initDatabaseStep]
06:31:11 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [initDatabaseStep] executed in 1s745ms
06:31:11 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [processConfigStep]
06:31:11 [main] INFO  c.s.n.d.m.p.QuartzJobDetailProcessor - Filtered QuartzJobDetail record Storage facet cleanup
06:31:11 [main] INFO  c.s.n.d.m.p.QuartzJobDetailProcessor - Filtered QuartzJobDetail record Cleanup service
06:31:11 [main] INFO  c.s.n.d.m.p.QuartzJobDetailProcessor - Filtered QuartzJobDetail record test
06:31:11 [main] INFO  c.s.n.d.m.p.QuartzTriggerProcessor - Filtered QuartzTrigger record Storage facet cleanup
06:31:11 [main] INFO  c.s.n.d.m.p.QuartzTriggerProcessor - Filtered QuartzTrigger record Cleanup service
06:31:11 [main] INFO  c.s.n.d.m.p.QuartzTriggerProcessor - Filtered QuartzTrigger record test
06:31:11 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [processConfigStep] executed in 223ms
06:31:11 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [processComponentStep]
06:31:11 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [processComponentStep] executed in 169ms
06:31:11 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [createRebuildRepositoryTasksStep]
06:31:11 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [createRebuildRepositoryTasksStep] executed in 21ms
06:31:11 [main] INFO  o.s.batch.core.job.SimpleStepHandler - Executing step: [finalDatabaseStep]
06:31:11 [main] INFO  o.s.batch.core.step.AbstractStep - Step: [finalDatabaseStep] executed in 32ms
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - Migration job finished at Tue Nov 29 06:31:11 GMT 2022
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - Migration job took 5 seconds to execute
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - 117 records were processed
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - 6 records were filtered
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - 0 records were skipped
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - 111 records were migrated
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - Created 'Rebuild repository browse' and 'Rebuild repository search' tasks. They will automatically one-time run after starting your Nexus Repository instance.
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - Migrated only early access formats: [APT, COCOAPODS, CONAN, CONDA, DOCKER, GITLFS, GO, HELM, MAVEN2, NPM, NUGET, P2, PYPI, R, RAW, RUBYGEMS, YUM]
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - Cleaning orient temporary files...
06:31:11 [main] INFO  c.s.n.d.m.l.ProvidingJobInfoListener - Cleaning finished

It looks like a new node ID is created. In the database there are different entries for private.ks and trusted.ks than on the filesystem. How can I import the existing id (keys)?

Hi Marco, I believe that issue was fixed in 3.43. If you have a support contract (which seems likely given you’re using a Pro feature) I’d suggest filing a ticket.

@mpiggott Thanks for your answer. Yes, with 3.43 it is working. We were still on 3.42.