Migrating Database from Version 184 to 221 (and SQLite to Postgresql)

Hello, we were still using a GSE install with gvm-libs version 9 and need to update to the latest stable version.

I installed a new VM from scratch and compiled all the parts needed, now it was time to migrate all the data over. I copied over the SQLite Database that was used with the old installation and tried using the gvm-migrate-to-postgres to migrate the data over to the postgres installation and then continue with gvmd --migrate to migrate it from version 184 to 221.

The gvm-migrate-to-postgres worked after I commented this section which should not be needed (I think)

 #HAVE_CACHE=`sqlite "SELECT EXISTS (SELECT FROM sqlite_master WHERE type='table' AND name='permissions_get_tasks');"`
  #if [ "$HAVE_CACHE" != "0" ]
  #then
  #  sqlite "UPDATE permissions_get_tasks SET has_permission = 1 WHERE has_permission != '0';"
  #  test_sql_exit "Failed to clean permission_get_tasks"
  #fi

Where I run into issues is with the gvmd --migrate, it just logs database migration too hard (that one actually cracked me up :smiley:) . I then tried experimenting by manually changing the database version to find out which is the minimum supported version, this is 189 which is 5 versions too new for our old database :confused:

How can I (maybe manually?) migrate those 5 versions needed for the new gvmd to pick it up and migrate it?

GVM versions

gsa: 9.0.1
gvm: 9.0.1
openvas-scanner: 1.0.1
gvm-libs: 11.0.1

Environment

Operating system: Debian 10.4 “Buster”
Kernel: 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07)
Installation method / source: Sourcecode from the releases on Github

You can´t skip version, you need to migrate GVM 9 -> GVM 10 -> GVM 11, additional you need to migrate from SQLite to PSQL on a version that still supports both storage types, but you already managed this. Now you need to migrate to GVM 10, and then to GVM 11.

1 Like

Hi Lukas,

thank you for your prompt answer, I was expecting that answer but was hoping there was a way around it :smiley:

Thank you very much for your help!

1 Like