Is it possible in OH2 to copy the database from one instance to another? Specifically, a setup on an ubuntu machine to a Pi?
I don’t see why not. Just make sure to grab the userdata folder as well as the configurations (i.e. /etc/openhab2).
There might be some problems if the bindings you’ve installed rely on some native libraries as those native libraries will not work on the Pi.
Personally, I would fill out runtime.cfg and addons.cfg with your configurations and installed addons and just move the configurations folder over. This will ensure you have the correct versions of bindings for the platform. The only problem will be that you will have to redo some initial configuration on some of the bindings (e.g. you will get a new uuid and secret from my.openhab, you will need to re-set up the serial connection for zwave, etc). And since you have to redo that it may result in a new name for some of your Things.
Both approaches have their advantages and disadvantages.