-
-
Notifications
You must be signed in to change notification settings - Fork 7
[Enhancement] Migration from official securecompliance/gvm image #16
Comments
I started on this see the mention in #14 I would check the version in the database storage path, and them it need to update major version to the next major version, excepted of this behavior is all pre 10 major version. I‘m not sure currently how much versions need to migrated so my initial Dockerfiles includes more then I think that are needed. 11to12 and 12 to 13 should work easy only from 13 to 14 needs additional steps. If you like to contribute, you are welcome. But I need to know this, else I will do it myself hopefully by end of the next week. regards Josef |
Btw. It will not work within the default container and should be done in an extra image that can reused with other installations (#14) |
Hi Josef, I tried to get going on this but won't have time before next week with the holidays and all. |
I started with a initial setup here: https://github.com/DeineAgenturUG/greenbone-gvm-openvas-for-docker/tree/db_upgrade It will need for sure more work, maybe a other way. I try how I can fix the issues that I see. |
Here a working development build. Once you have done, please make sure you have a backup created before you running this following steps. Also this step create the right permissions for the new database. So you don't need to have a eye on this. Right after all steps are done, you can use our image
Then you have to run in the container shell: ℹ️ I hope you can enjoy the "DB Upgrade" tool and let me know how it works for you, any feedback is welcome. |
Hi @Dexus, Thank you! Will try it out as soon as I'm done coaching my son for his mid year exams. Best Regards,
|
Once it's tested a bit more and I get some feedback on it, it will be added to the gvm image as well. So there is no need for an extra image. |
So here's what I did to test it with your instructions in mind:
It worked without a hitch. Thank you! I've attached the output of the docker container during the upgrade: |
@landonstewart Your log shows an identical output to mine. Perfect! |
The conversion is successful but when the docker starts this error is thrown: gvmdebian | redis: started |
I think i found the problem. -rw-r--r-- 1 syslog input 0 Apr 23 14:13 .firstrun and -rw-r--r-- 1 syslog input 0 Apr 23 14:13 .upgrade_to_21.4.0 |
Hi @landonstewart, would it be alright to send me your docker-compose.yml please so I can take a look? I think I'm doing something wrong with the volumes. Thank you.
|
@netbix you previous image/tag was which one? Okay don't need to have this info, it's right that the file is missing because it will not copied. Will fix it in the evening. |
i migrated from: I have change my config with: USERNAME=admin and compose: version: '3.4' services: gvmdebian: with those two files everything works |
Yes I had not thought about the lock files. Will fix it in the evening, and release a new upgrade image. |
what is this variable for? export NO_AUTO_UPDATE=${NO_AUTO_UPDATE:-NO} |
thank you ! |
I hope I did not use it, had used it in a local test. It's the opposite of the have to say you all thank you for the feedback. |
root@gvmdebian:/# gvmd --get-scanners |
Hi @Dexus, I ran the latest
Have confirmed I'm running the latest
|
@markdesilva can you please send me a copy from your old DB as a .tar.gz/xz ? https://nc.josef-froehle.de/s/GmMW3txfAW8mCpY |
Sure, the whole thing is 4.3GB though, not sure if it'll go through. Let me try. |
Should not be a problem for my Server, if you have an alternate storage where I can download it, I can do it. Then you can send me a link to github@josef-froehle.de |
After compression its a few hundred MB. Uploading now. |
Upload is complete. Thanks! |
Hmm, nothing there. But got an error in the logs. Forgot to set the Upload limit in one config file which now is fixed. Can you re-try? Edit: @markdesilva thank you upload is there now. |
Done! Thanks. |
New Version is ready.
Fixed:
|
- don't run upgrade on the current default DB for gvm - touch `.firstrun` and `.upgrade_to_21.4.0` - don't modify old config files only copy them for the upgrade an change port only on the temporary OLD_DATA - fix new `OpenVAS Default` socket path
- allow on temporary old DB to connect form all IP as trust also #16
- don't run upgrade on the current default DB for gvm - touch `.firstrun` and `.upgrade_to_21.4.0` - don't modify old config files only copy them for the upgrade an change port only on the temporary OLD_DATA - fix new `OpenVAS Default` socket path
- allow on temporary old DB to connect form all IP as trust also #16
- don't run upgrade on the current default DB for gvm - touch `.firstrun` and `.upgrade_to_21.4.0` - don't modify old config files only copy them for the upgrade an change port only on the temporary OLD_DATA - fix new `OpenVAS Default` socket path
- allow on temporary old DB to connect form all IP as trust also #16
- don't run upgrade on the current default DB for gvm - touch `.firstrun` and `.upgrade_to_21.4.0` - don't modify old config files only copy them for the upgrade an change port only on the temporary OLD_DATA - fix new `OpenVAS Default` socket path
- allow on temporary old DB to connect form all IP as trust also #16
Fix problem with old `libgvm-pg-server` part 4 Fix problem with old `libgvm-pg-server` part 3 - run on new db. Fix problem with old `libgvm-pg-server` part 2 - run on new db. Fix problem with old `libgvm-pg-server` - also remove existing DOTFILES in new DB path to make the directory real clean. Fix wrong (already edited) copy of configs to new DB fix version equal check and 2 sed replaces Get from old DB and set on new DB `LC_COLLATE` and `LC_CTYPE` - allow on temporary old DB to connect form all IP as trust also #16 Fix some findings from #16 with the db_upgrade.sh - don't run upgrade on the current default DB for gvm - touch `.firstrun` and `.upgrade_to_21.4.0` - don't modify old config files only copy them for the upgrade an change port only on the temporary OLD_DATA - fix new `OpenVAS Default` socket path db_upgrade Container: remove `set +x` db_upgrade Container: working db_upgrade.sh tool for old securecompliance images db_upgrade Container: add TODO notice db_upgrade Container: make sure the DB is created the same way db_upgrade Container: bring logic to the process db_upgrade Container: add supervisord.conf Initial db_upgrade Container
Fix problem with old `libgvm-pg-server` part 4 Fix problem with old `libgvm-pg-server` part 3 - run on new db. Fix problem with old `libgvm-pg-server` part 2 - run on new db. Fix problem with old `libgvm-pg-server` - also remove existing DOTFILES in new DB path to make the directory real clean. Fix wrong (already edited) copy of configs to new DB fix version equal check and 2 sed replaces Get from old DB and set on new DB `LC_COLLATE` and `LC_CTYPE` - allow on temporary old DB to connect form all IP as trust also #16 Fix some findings from #16 with the db_upgrade.sh - don't run upgrade on the current default DB for gvm - touch `.firstrun` and `.upgrade_to_21.4.0` - don't modify old config files only copy them for the upgrade an change port only on the temporary OLD_DATA - fix new `OpenVAS Default` socket path db_upgrade Container: remove `set +x` db_upgrade Container: working db_upgrade.sh tool for old securecompliance images db_upgrade Container: add TODO notice db_upgrade Container: make sure the DB is created the same way db_upgrade Container: bring logic to the process db_upgrade Container: add supervisord.conf Initial db_upgrade Container
Fix problem with old `libgvm-pg-server` part 4 Fix problem with old `libgvm-pg-server` part 3 - run on new db. Fix problem with old `libgvm-pg-server` part 2 - run on new db. Fix problem with old `libgvm-pg-server` - also remove existing DOTFILES in new DB path to make the directory real clean. Fix wrong (already edited) copy of configs to new DB fix version equal check and 2 sed replaces Get from old DB and set on new DB `LC_COLLATE` and `LC_CTYPE` - allow on temporary old DB to connect form all IP as trust also #16 Fix some findings from #16 with the db_upgrade.sh - don't run upgrade on the current default DB for gvm - touch `.firstrun` and `.upgrade_to_21.4.0` - don't modify old config files only copy them for the upgrade an change port only on the temporary OLD_DATA - fix new `OpenVAS Default` socket path db_upgrade Container: remove `set +x` db_upgrade Container: working db_upgrade.sh tool for old securecompliance images db_upgrade Container: add TODO notice db_upgrade Container: make sure the DB is created the same way db_upgrade Container: bring logic to the process db_upgrade Container: add supervisord.conf Initial db_upgrade Container symlink `/usr/lib/libgvm-pg-server.so` to `/usr/local/lib/libgvm-pg-server.so` to be correct
Describe the solution you'd like
Many folks, including myself, are using the official but outdated image
securecompliance/gvm
. It would be nice to be able to switch from that image to this more actively developed one.When using
deineagenturug/gvm:latest-data-full
as a drop in replacement forsecurecompliance/gvm:debian-master-data
there are problems with PostgreSQL. Likely because of the version differences.A check on first start and migration would be really excellent. Failing that - a method to migrate existing data would be great.
ALSO - I'm capable and willing to clone and send pull requests if you can give me a basic overview of how the check/migration should work. At this point its not clear and I'd need to get up to speed before attempting to contribute changes.
The text was updated successfully, but these errors were encountered: