Backup/Restore minimum requirements

Hi, i know the backup procedure from DOCs but ask myself if it still works to only restore the folder /var/lib/openhab2/jsondb? I did it and right now it works …so blank system from scratch and only restored this folder…

In my case (OH2.2snapshot) i only do configure zwave items via PaperUI, so in jsonDB i have all the items and things zwave-related…which is the most work to reconfigure all these 40items…the rest of items is directly in items config folder as before in OH1…

Does this work or something important may run into issues as the backup is way more complex and only jsondB will not work for these zwave items…???
Regards Norbert

The 2.2. SNAPSHOT now has a backup and restore script you can run which does everything for you. You can look at that script and see what all it does to see if you are missing something, but I believe what you did (i.e. only restoring the JSONDB) will cause you to not have all your bindings reinstalled on the new instance unless you are using addons.cfg to manage your addons.

Thanks Rich for the feedback. I know that in jsondb there is only covered items/things. So i manually have to add bindings + e.g., settings like UI specific config or location geo data. but this is rather easy compared to zwave items setup from scratch.

My question/fear was that by only considering jsondb there could be something important not be covered which in the end collides with the rest of the system as it does not fit. So if jsondb is isolated and does not rely on anything else i would be happy, so my restore would mean to be complete and no fragments left from the new setup which never runs in sync with my restored jsondb…hope its exactly that way :slight_smile:

I’m asking especially as still my problem is yet not solved.
I started a complete new installation, did add my old item/rules/…files + the jsondb folder…all works fine…
after a reboot all items are shown in the GUI with default labels,…reboot…clearing the cache/tmp folder does not solve anything…

Any idea what could be wrong…
in the following threat already others seem to have the same problem…which is really painful as it comes after first restart and never goes away…items defined in the items file are shown correctly.

Metering via zwave (from jsondb, except the first entry))
as you can see, no custom labels anymore, icons are gone,…
image

Switching via zwave (from jsondb)

image

hm…these error messages at start confirm the issue with double entries, but where do they come from? Simply added the jsondb folder…no other restoring or manual entry of the same items via PaperUI or even in the classic .items files…

2017-10-07 22:58:02.551 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'WellWater_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.553 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'PVng4_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.554 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'Devolo3_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.556 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'Devolo1_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.557 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'Router_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.559 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'HouseNr_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.560 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'LRMotionSensor_Temperature' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.562 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'LC13Thermostat_Setpoint' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.564 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'FRISTAR_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.565 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'DriveInRelay_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.567 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'LivingRoom_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.568 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'Devolo3_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.569 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'FibaroFlood_Batt' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.571 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'RH_Basement' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.572 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'FibaroFlood_Temp' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.574 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'LivingRoom_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.575 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'Router_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.577 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'SmartDroid_Cpu_Load' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.578 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'EntryEGMotionSensor_Luminance' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.579 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'Fibaro_FloodAlarm' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.581 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'PVng4_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.582 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'LRMotionSensor_BatteryLevel' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.584 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'PVisland_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.585 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'DevoloKeyFOB_BatteryLevel' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.586 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'Air_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.588 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'HomeOffice_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.589 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'Solar_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.591 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'PVng5Poly_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.592 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.DateTimeItem with key'LocalTime_Date' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.594 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'PVisland_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.595 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'EntryEGMotionSensor_MotionAlarm' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.597 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'KitchenFlood_BatteryLevel' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.599 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'LC13Thermostat_BatteryLevel' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.600 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'MaxKalk_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.602 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'EntryEGMotionSensor_BatteryLevel' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.604 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'DriveInRelay_Switch2' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.606 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'LRMotionSensor_Luminance' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.608 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'Solar_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.609 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'FRISTAR_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.610 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'ZWaveNode52DevoloKeyFOB_SceneNumber' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.612 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'AxisVideo_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.614 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'KitchenFlood_Alarm' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.615 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'Gas_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.618 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.DateTimeItem with key'LocalSun_Set_StartTime' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.619 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'DBlight_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.620 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'PVng5Mono_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.622 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'MyMinimote_SceneNumber' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.623 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'Air_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.625 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'ST814_BatteryLevel' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.626 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'DBlight_Switch2' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.628 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'DBlight_Switch1' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.630 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'WellWater_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.631 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'MaxKalk_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.632 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'FibaroKeyFOB_BatteryLevel' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.634 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'Gas_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.635 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.DateTimeItem with key'LocalSun_Rise_StartTime' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.636 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'AxisVideo_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.638 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'PVng5Mono_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.640 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'LRMotionSensor_MotionAlarm' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.641 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'Devolo1_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.643 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'PVng5Poly_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.644 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'HouseNr_Power' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.645 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'FibaroKeyFOB_SceneNumber' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.647 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'HomeOffice_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.648 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'Temp_Basement' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.649 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'Everspring_Switch' already exists! Failed to add a second with the same UID!
2017-10-07 22:58:02.651 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'EntryEGMotionSensor_Temperature' already exists! Failed to add a second with the same UID!

Unfortunately, I’m not going to be able to help with this problem. I can’t answer why it went wrong nor how to fix it. All I can suggest is to double check that your JSONDB files do not list these items more than once.

Most of the userdata needs to be backed up. It should be noted that some bindings have their own folder in which they have configurations stored. For example $OPENHAB_USERDATA/zwave contains the information about each node in .xml format. The things in JSON format would rely on these files.

In simple terms, the $OPENHAB_USERDATA holds all the configuration you do in using the UIs. $OPENHAB_CONF contains anything you have defined using text files. I believe Settings in $OPENHAB_CONF override anything set in $OPENHAB_USERDATA

That said, your initial problem is perplexing, if names are correctly configured the first time I wouldn’t expect it to fault after a restart.

Hi Rich,
i now followed your path and removed items from PaperUI, but kept THINGS in PaperUI…and created the items manually in items files.

however still after a restart i can see the items from items-file linked to the paperUI things in the PaperUI environment…plus i also see the items in the jsondb file…the later confuses me the most, as i removed them from PaperUI my believe is that also the jsondb file will not cover these again…

plus I see these logs…
2017-10-11 22:54:52.238 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key ‘SmartDroid_Cpu_Load’ already exists! Failed to add a second with the same UID!
2017-10-11 22:54:52.247 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key ‘LivingRoom_Switch’ already exists! Failed to add a second with the same UID!
2017-10-11 22:54:52.248 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key ‘LivingRoom_Power’ already exists! Failed to add a second with the same UID!
2017-10-11 22:54:52.249 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key ‘HomeOffice_Switch’ already exists! Failed to add a second with the same UID!
2017-10-11 22:54:52.251 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key ‘HomeOffice_Power’ already exists! Failed to add a second with the same UID!

Did you happen to try and Link Items defined in .items files to a Channel using PaperUI at some point? On another thread, we discovered that that can cause PaperUI to create a duplicate of the Items in JSONDB. So what you probably need to do is unlink the Items in PaperUI if you can. Stop OH. Delete the Items from JSONDB. If you couldn’t unlink the Items then you need to do so from the Things JSON DB entries. Then restart OH and in the future only link to channels using { channel=“thing id” } in the .items file.

Thanks, Rich…

So i should (after STOP service) remove manually the lines in jsonDB items
file?

Question, is it OK to have THINGS kept in PaperUI and items in .items files
linked via channel?
Therefore my believe is/was that automatically PaperUI does again the
linking in the GUI…(but it should not write these in the JSONDB I guess).

I more and more tend to keep all things/items in txt files, as some docs
already suggest…

That is what I would try. This is all new to me so I’m just guessing whether this will work. Obviously backup backup backup.

You never want to edit the JSONDB while OH is running.

Yes but you need to make the link to the Channel in the .items file, not through PaperUI.

I now removed the items from json items file…they do not add anymore after restart…however I still have the following messages…
However there are still lines inside the itemchannellink.json…file. Should i remove these as well, i guess so…

2017-10-12 22:05:47.728 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.NumberItem with key'LivingRoom_Power' already exists! Failed to add a second with the same UID!
2017-10-12 22:05:47.734 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.library.items.SwitchItem with key'LivingRoom_Switch' already exists! Failed to add a second with the same UID!
2017-10-12 22:05:48.389 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local
2017-10-12 22:05:48.662 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local
2017-10-12 22:05:48.713 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.thing.link.ItemChannelLink with key'Solar_Power -> zwave:device:6f2c15ba:node8:meter_watts' already exists! Failed to add a second with $
2017-10-12 22:05:48.720 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.thing.link.ItemChannelLink with key'Router_Switch -> zwave:device:6f2c15ba:node16:switch_binary' already exists! Failed to add a second $
2017-10-12 22:05:48.743 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.thing.link.ItemChannelLink with key'WellWater_Power -> zwave:device:6f2c15ba:node10:meter_watts' already exists! Failed to add a second $
2017-10-12 22:05:48.782 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.thing.link.ItemChannelLink with key'Solar_Switch -> zwave:device:6f2c15ba:node8:switch_binary' already exists! Failed to add a second wi$
2017-10-12 22:05:48.797 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.thing.link.ItemChannelLink with key'WellWater_Switch -> zwave:device:6f2c15ba:node10:switch_binary' already exists! Failed to add a seco$
2017-10-12 22:05:48.823 [WARN ] [ore.common.registry.AbstractRegistry] - org.eclipse.smarthome.core.thing.link.ItemChannelLink with key'Router_Power -> zwave:device:6f2c15ba:node16:meter_watts' already exists! Failed to add a second wit$
2017-10-12 22:05:50.163 [INFO ] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been started

Probably.