Migrating db from GVM 11 to GVM 20.08

Hi,

I have an old GVM 11 appliance as I havent been able to update it since it is always in use. Thanks for the great product btw. :slight_smile:

Anyways I wanted the latest and greatest GVM version.
So I made a new vm with docker installed. Created a GVM 20.8 container (Everything built from source), tested it and everything seemed to work. So it was time to import db from GVM 9.

I exported postgresql dump from GVM 9 in the form of a plain text sql script(also tried with tar archive later).
I dropped the db from GVM 20.08 and built a new one with the commands:

    su -c "createdb -O gvm gvmd" postgres
    su -c "psql --dbname=gvmd --command='create extension \"uuid-ossp\";'" postgres
    su -c "psql --dbname=gvmd --command='create extension pgcrypto';" postgres

And imported the dump from GVM 9. Did all the necessary NVT, CERT, SCAP, GVMD Data syncs and all completed successfully. After that i migrated postgresql db with gvmd --migrate. No errors.
Next i tried getting uuid for admin account with gvmd --get-users, and it says “Database is wrong version.”

Checked gvmd logs, it says

md manage: INFO:2020-09-15 05h22.29 utc:4505: Getting users.
md manage:MESSAGE:2020-09-15 05h22.29 utc:4505: check_db_versions: database version of SCAP database: 15
md manage:MESSAGE:2020-09-15 05h22.29 utc:4505: check_db_versions: SCAP database version supported by manager: 16

So I reran migration and checked the logs:

md main:MESSAGE:2020-09-15 05h35.11 utc:65: Migrating SCAP database
md manage:WARNING:2020-09-15 05h35.11 utc:65: gvm_migrate_secinfo: unsupported feed_type
md main:CRITICAL:2020-09-15 05h35.11 utc:65: gvmd: SCAP database migration failed

Is GVM 9 too old to be imported into GVM 20.8? Should I drop the feeds tables from db and try syncing again?

Best wishes,
mark0w

GVM versions

gsad: 20.80
gvmd: 20.8.0
openvas-scanner: 20.8.1
gvm-libs: 20.8.0

As said here, you can´t migrate to GVM11 or GVM 20.08 you need first migrate to GVM10 then GVM11 and then you can migrate to GVM 20.08.

1 Like

@Lukas Sorry, gave You the wrong versions.

The old env is running:
gsad: 9.0.1
gvmd: 9.0.0
openvas-scanner: 7.0.0
gvm-libs: 11.0.0

So it is version 11 i presume.

@bricks @Lukas Can You confirm that it works? Have You tested it yourselves? Sorry for being pushy.

I don’t know what’s wrong here. You should be able to migrate from GVM 11 to GVM 20.08. Maybe you can try to update gvmd to the latest 11 release version (should be 9.0.1 see GVM 11 (old stable, initial release 2019-10-14)) and do the migration afterwards.

Just to be sure you did import the old db using the same installation prefix and did run gvmd --migrate with the new gvmd?

1 Like

Imported the db in a GVM application that has gvmd 9.01 and gvm-libs 11.0.1, it did some updates, then imported it to GVM 20.08 and migration went through succesfully!
Might take a while to see if it actually works

2 Likes

OK, so everything works except report generator. I cant open reports. It says the file is missing.
run_report_format_script: No generate script found at /usr/local/var/lib/gvm/gvmd/report_formats/generate

Fixed it by moving the required files from GVM 9 to the newer GVM application

2 Likes