Can’t load features repository after restoring from backup (full)

I had a running OH4.0 on a VM and decided to upgrade it and move my home automation from the vm running OH3.4.4
As part of that I did a backup --full on oh3.4.4 and a restore on oh 4.0.1

Now, when I try to start openHAB the log starts like this:

2023-07-31 12:26:33.967 [ERROR] [internal.service.FeaturesServiceImpl] - Error notifying listener about the current state
java.lang.RuntimeException: Error resolving artifact org.apache.karaf.features:framework:xml:features:4.3.7: [Could not find artifact org.apache.karaf.features:framework:xml:features:4.3.7 in openhab (] : mvn:org.apache.karaf.features/framework/4.3.7/xml/features

followed by the usual verbose error trace.
The error msg repeats several times with a slightly different form

Can't load features repository mvn:org.apache.karaf.features/standard/4.3.7/xml/features
java.lang.RuntimeException: Error resolving artifact org.apache.karaf.features:standard:xml:features:4.3.7: [Could not find artifact org.apache.karaf.features:standard:xml:features:4.3.7 in openhab (] : mvn:org.apache.karaf.features/standard/4.3.7/xml/features

Some addons seem to work , google.tts and mosquitto write to the log file. But then all I see is

2023-07-31 13:06:41.160 [INFO ] [core.karaf.internal.FeatureInstaller] - Some .kar files are not installed yet. Delaying add-on installation by 15s.

repeating again and again.

Search found a very old issue from 2018 with similar error messages, the solution back then was to remove 2 files that should not exist after an installation. One of them is present here with 0 bytes length, removing it made no difference.

Then I found Can't load features repository after upgrading to 3.4.1 and here the recommendation is to de/reinstall all addons found at tmp/mvn/org/openhab/addons/bundles which looks like all of them. However, in that case the error he got mentioned a version he had installed before while I don’t think I’ve had 4.3.7
Thus, while similar, that issue may well be a false friend. And it fails, I can not remove an addon via the web interface, all I get is the revolving arrow.
The console lists all the addons as 3.4.4 which is very odd since this was a running 4.0.0 before the restore.
I checked the package version:

dpkg -l |grep openhab
ii  openhab                        4.1.0~S3571-1                  all          openhab
ii  openhab-addons                 4.1.0~S3571-1                  all          openhab-addons

I cleared the tmp/ and cache/ but no change. After an attempted start openhab creates pathes in the tmp/ folder like


which looks messed.

Apparently, /var/lib/openhab/config/profile.config was restored, it has ‘3.4.4’ all over the place and with this find I guess it’s time to purge and rebuild the config manually, avoiding the restore

Do you use any Marketplace add-ons or do you have KAR files in your /addons dir? Removing those might help.