Secure-Compliance-Solutions-LLC / gitbook

Documentation of Secure compliance Solutions projects
https://securecompliance.gitbook.io/
4 stars 9 forks source link

How to migrate Postgres Database #20

Open schimpke opened 2 years ago

schimpke commented 2 years ago

There should be a section in the documentation what to do , if the version of the database changes (eg 12 to 13.3) . Even upgrading 21.4.0-v5 to 21.4.2-v1 does not work seem to work without some magical command (I tried a quick pg_dump -O gvmd > gsvmd.sql followed by psql -U gvm -f gvmd.sql ... in the new container without success...

schimpke commented 2 years ago

Hi, it seems, that I finally managed to migrate the database from 12.x to 13.y. Here are the steps:

On the 13.y database:

If you do not drop the schema in the target database, then you receive errors regarding foreign key violations and the import fails. So dropping seems to be essential. Further I got one error about a missing object in the public schema during the import. I still have to investigate this issue. But at least all old scan results, host, network and task definitions seem to be present. My colleagues will make some tests now.

Regards, Thomas

Dexus commented 2 years ago

For further support, use https://github.com/DeineAgenturUG/greenbone-gvm-openvas-for-docker

Dexus commented 2 years ago

Here we have now a image with the upgrade tool. That works. https://github.com/DeineAgenturUG/greenbone-gvm-openvas-for-docker/issues/16#issuecomment-1104247172