At present i have a Greenbone server that was running version 21.4.4. As it shows some errors and i would also want to upgrade i have installed the container version of 22.4.
All working fine till i had to import the old database.
I took a dump of the old database and copied over to the container data volume and tried to import it from pg-gvm but i got a lot of errors.
Checking the container version i see that it is running postgres 13 where my old server was running 12 and the db dump is on 12.
How can i migrate the db? I’ve checked also the container version for 21.4 but that one runs Postgres 13 as well.
Trying to run the pg 13 upgrade on the old server it gives me the below:
postgres@rimdub-vs-02:~$ LD_PRELOAD=/opt/gvm/lib/libgvm-pg-server.sopostgres@rimdub-vs-02:~$ export LD_PRELOADpostgres@rimdub-vs-02:~$ /usr/lib/postgresql/13/bin/pg_upgrade --old-datadir=/var/lib/postgresql/12/main --new-datadir=/var/lib/postgresql/13/main --old-bindir=/usr/lib/postgresql/12/bin --new-bindir=/usr/lib/postgresql/13/bin --old-options ‘-c config_file=/etc/postgresql/12/main/postgresql.conf’ --new-options ‘-c config_file=/etc/postgresql/13/main/postgresql.conf’
/usr/lib/postgresql/13/bin/pg_upgrade: symbol lookup error: /opt/gvm/lib/libgvm-pg-server.so: undefined symbol: SPI_processed
Hmm what about improve your Postgres skills first.
If you run a SQL database you should be able to backup and import a database at any time And that is independent of the delivery method (Container, Distribution or self compiled).
I don’t want to be mean here.
i dumped the database with “pg_dump gvmd > gvmd.sql”. then copied over the sql file to the destination server and imported with “psql gvmd < gvmd.sql” on a brand new empty database with the proper user and roles and extensions created, so what am i doing wrong?
also on the container one the user is changed from gvm to gvmd so more errors.
just used pg_dumpall as per the how to and also checked the DB is UTF8 on both servers.
I am trying to import to the pg-gvm container and i see a lot of
invalid command \n
invalid command \n
invalid command \n
invalid command \n
invalid command \n
invalid command \n
invalid command \n
invalid command \n
invalid command \nFixed
or like this
unrecognized value “NOTE:” for “tuples_only”: Boolean expected
invalid command \nthe
invalid command \nand
invalid command \tNOTE:
invalid command \N
invalid command \tNOTE:
invalid command \nJava
invalid command \nthe
invalid command \nthe
invalid command \nand
invalid command \tNOTE:
invalid command \nthe
unrecognized value “NOTE:” for “tuples_only”: Boolean expected
invalid command \nthe
invalid command \tNOTE:
invalid command
invalid command \tNOTE:
unrecognized value “NOTE:” for “tuples_only”: Boolean expected
invalid command
invalid command \tNOTE:
ERROR: syntax error at or near “4169”
LINE 1: 4169 oval:org.mitre.oval:def:11397_/oval/5.10/org.mitre.oval…
right. so if i drop the database prior to import i can import no issue. now i need to see how to combine the 2 databases into one as i need to combine 2 servers into one.