Remove openhab2 files

I have still some openhab2 files in my installation.
Is it save to remove it after i’ve upgraded to openhab 3?
So I understand that openhab3 works from the etc/openhab and no longer anymore from the files in etc/openhab2

Correct, you can remove /etc/openhab2 as well as /var/lib/openhab2 once you are done with your upgrade and sure you no longer need anything from your old installation.

and do you know the command herefore?

nevermind, i allready found the solution:

sudo apt purge openhab2