There are a lot of posts on this. Here is one:
[SOLVED] From RPI3+b to RPI 4 - Setup, Configuration and Use / Installation - openHAB Community
There are a lot of posts on this. Here is one:
[SOLVED] From RPI3+b to RPI 4 - Setup, Configuration and Use / Installation - openHAB Community