openHAB3 upgrade not finding old version

I just tried to install OH3 on a Pi 3B. It uninstalled OH2 (2.5.12) but didn’t ask about newer versions of files as detailed in the upgrade instructions. When OH3 started there was nothing there and there doesn’t appear to be a way to import the old jsondb or import the old config files.
I quit the service and uninstalled and purged OH3. On reinstalling OH2 it restarts with all the old Things etc.
I tried again and exactly the same happened. Is there a way to import the old jsondb and config files (by copying them to the new locations for example)?

You can create a backup of the old instance’s configuration files using openhab-cli backup and restore the files using openhab-cli restore see openHAB on Linux | openHAB

Will restore be able to restore OH2 files to OH3 though? If so why doesn’t the documenation say that because, in the upgrade instructions it says backup “will create a zip file which can be used to restore the same version of openHAB later”?

I followed those instructions but it didn’t behave as expected.

The system will ask you if you want to remove openhab2 as part of this, and you should respond with “y”. After the install continues it will warn you that several of your configuration files have newer versions, mostly your answer to these should be yes to install the maintainer’s versions, take a note of which files these are as the installer will save them in the same location as “.old” files if you want to copy something specific across.

It didn’t ask me if I wanted to remove openHAB2 (but it gave a message saying that it had removed it) nor did it warn me about the configuration files having newer versions.
openhab-cli now appears to be broken as openhab-cli backup gives me the following error message

/usr/bin/openhab-cli: 88: /usr/bin/openhab-cli: /bin/backup: not found

this means that the $OPENHAB_RUNTIME environment variable is not set.

I’ve tried adding to the $PATH

echo $PATH /home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/usr/share/openhab2/runtime:OPENHAB_RUNTIME=/usr/share/openhab2/runtime

but I still get the same result

/usr/bin/openhab-cli: 88: /usr/bin/openhab-cli: /bin/backup: not found

This seems to be a misunderstanding.
The environment variable OPENHAB_RUNTIME needs to be available in your system.
You may do a trial:
set the environment variable in your shell
export OPENHAB_RUNTIME=/usr/share/openhab2/runtime
export OPENHAB_RUNTIME=/usr/share/openhab/runtime
depending if you are on OH2 or OH3.
then run openhab-cli.
In case you still get the same error message ( /usr/bin/openhab-cli: /bin/backup: not found ) then I would assume that the environment variable OPENHAB_RUNTIME is deleted because of settings that are sourced from files that are being executed from within openhab-cli.