your best option is to save all your data
sudo openhab-cli backup -full
, then copy the resulting zip file to e.g. a network share- save all additional data from yous system (maybe mosquitto configuration, InfluxDB Data, grafana.ini and so on)
Get a new Micro-SD card and download the 32-Bit Version of openHABian Image to the card.
save the zip file to the first partition and name it to initial.zip
Pass the card to the Raspberry Pi and let do openHABian its magic.
Install additional software as needed, afterwards copy old data and configuration to the new card.
Please be aware that the 64 Bit OS does need much more RAM as the 32 Bit version (which is the whole point of using the 32 Bit version), it’s not only Java…
Alternatively, buy a brand new Pi5 or a older Pi4 with 8 GByte of RAM and use the 64 Bit Version, but you will have to setup a new Micro SD card for the new hardware as well