Reduce hdd space

II am using Openhab 2.5 on a Raspberry pi 4 that boots from a 500Gb usb hdd. That hdd is overkill and that is why I want to reduce the size of the hdd to 16Gb so that the image fits on a micro sd again. That does not work with PiShrink. That’s why I flashed a clean Openhabian 3 on a 16Gb sd card and now want to transfer all settings, things, items, rules, etc from the hdd to the sd. How do I do that best?

You are asking a Linux / Debian / Raspi OS question. Those experts are not likely on this openHAB forum. the openHABian image is just Raspi OS Lite.

Too bad, but thank you.

as long as you talk about OH settings, things, etc. you can use

openhab-cli backup

to create a backup. This will stored in a zip file. This zip file can be imiported again using

openhab-cli restore

see openHAB on Linux | openHAB

Thanks, I will do so. Does it also works when I backup OH 2.5 and restore it on OG 3?