Openhabian: Moving to new SD-Card: What has to be copied?

Hello!

i want to move my Openhabian installation to a new SD-Card. That means, I want to have a new installation on a another SD-Card, but keep all bindings and so on. What do I have to backup then?

  • JSONDB
  • Configuration folder with item,- rules-…-files

Anything else?

Is it after a new installation possible to just paste the old files on the new folders?

Just perform the backup and restore procedure.

If I copy it, it will not work?

What exactly do you mean?
Copying files in Linux?
http://man7.org/linux/man-pages/man1/cp.1.html

You could do a image backup / restore https://lifehacker.com/how-to-clone-your-raspberry-pi-sd-card-for-super-easy-r-1261113524

Here’s another tutorial to clone your SD card and restore the image. Works with Windows, Linux and Mac. https://beebom.com/how-clone-raspberry-pi-sd-card-windows-linux-macos/ You can even compress the image with PiShrink.

Today I tried the SD Image& resore with the Win32DiskImager (on a WIN10 machine). I thought it would be a good idea before mirgate from OH2.4 to 2.5 :wink:
I did that before with 2 identical Toshiba 32GB SD cards. Now one of them is used for something else so I bought a new one 32GB from Verbatim.
But writing the image to the Verbatim now fails!
During the writing process the imager claims that there is less space then the image size. The Verbatim has only 29.8GB free space! The OH installation is far less, and it comments also “additional space seems to contain no data”. The restore process works without failiure, but OH will not start from this card. No blinking on the raspi, nothing.
What ca I do, to get my image to the new card?

Holger

You may need to use a partition editor to shrink the size of the SD card with the image. Do a google search for how to do this without erasing whats on the card. I use linux PC and Gparted for such but not sure what works best for Windows but sure you will find it with a search.

Maybe this is an option, but I don’t want to do experiments on the productive system :thinking:

You can always use sudo openhab-cli backup --full then move the zipped file to another location (USB or PC I use FileZilla for this) then install a fresh image on the new card then restore your backup.

Doing it this way you can keep your production SD until you verify the new SD is working.:wink: To restore the backup stop OH first sudo systemctl stop openhab2, place the zip file in the backup location then sudo openhab-cli restore /var/lib/openhab2/backups and sudo systemctl start openhab2

Ok, I’ll give this a try tomorrow. Thanks!

Check my post, I made a few corrections/edits.

You run openHABian on a Pi but shut it down to backup on Windoze ? :roll_eyes:
There’s Amanda to be part of the system, and you can also use low level tools such as dd for one-time copies.
But yes, if you copy raw partitions, the destination has to be at least as large as the source.
So better reinstall (take the opportunity to go down to 8 GB) and use openhab-cli backup/restore to copy your config.

Ok, today I setup a new openhabian installation on the new card. The install worked, also access to the UI.
then I restored the backup as H102 described. But it seemms, that this is not compatible to OH2.5 :frowning:
I get many errors, this one is coming repeatedly:

2019-12-21 10:59:17.613 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-package-standard': No matching features for openhab-package-standard/0

2019-12-21 10:59:17.865 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-gpio, openhab-misc-restdocs, openhab-binding-avmfritz, openhab-binding-network, openhab-ui-habpanel, openhab-binding-yamahareceiver, openhab-binding-zwave, openhab-binding-gpio1, openhab-persistence-rrd4j, openhab-ui-basic, openhab-transformation-map, openhab-binding-ntp, openhab-action-mail, openhab-binding-fritzboxtr0641, openhab-binding-astro, openhab-ui-habmin, openhab-binding-souliss1, openhab-binding-systeminfo, openhab-ui-paper': Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-runtime-base; type=karaf.feature; version="[2.4.0,2.4.0]"; filter:="(&(osgi.identity=openhab-runtime-base)(type=karaf.feature)(version>=2.4.0)(version<=2.4.0))"

I have only acces via putty and frontail, but none of the UIs nor my Habpanel. What can I do now?

Stop OH, clean the cache, and reboot. You may need to restart OH a few times to get everything loaded.

Also read the change log as the restdocs have moved from misc to ui. Did you uninstall the restdocs addon before making a backup on 2.4?

Ok, I will check that.
I did not remove the restdocs on 2.4 because I need that and this is the productive system.

You can reinstall it after the upgrade.

I think the new install OH2.5 and copying the configuraton from the 2.4 installation back was not the best idea!
Clearing cache and restarting OH gets the system running incl the UI’s, BUT:

  • RestDocs not working (ok, I knew that)
  • GPIO Binding not loading/working
  • Broadlink no longer working
  • Samba shares are gone
  • MQTT broker not copied. I tried to install the new MQTT binding, but it does not connect
2019-12-22 11:27:24.114 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.178.55' with clientid 247a67ee-9d7e-4a5e-b829-34aa5d5b9fb9

2019-12-22 11:27:24.187 [hingStatusInfoChangedEvent] - 'mqtt:systemBroker:mqttson' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /192.168.178.55:1883

Thats really frustrating, 8h of hacking, and nearly nothing useful is working :frowning:
Maybe its better to get another fitting SD card and do only the upgrade to 2.5 without touching anything else.

This is a good sign. Now Stop try restarting OH a few times, waiting each time for OH to fully load each time and see if that helps. There have been several reports that this has been need to get everything working.

Also post the logs about the other binding that are not loading as well as mqtt if the problem persist.

Hi, I am back again.
I received my 2. identical SD card and made a image copy.
Unistalled REST docs and made the upgrade to OH2.5 and reinstalled REST.
I also cleared the cache and restarted several times.

Still I have the following issues:
-GPIO binding

2019-12-28 16:41:40.374 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-gpio'

-ZWAVE not working, creates repeatedly:

2019-12-28 16:30:57.568 [me.event.ThingUpdatedEvent] - Thing 'zwave:serial_zstick:15f71b6bf6d' has been updated.

2019-12-28 16:31:15.224 [vent.ItemStateChangedEvent] - zwave_serial_zstick_15f673bb2bc_serial_can changed from 0 to 1

2019-12-28 16:31:33.286 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:15f71b6bf6d' changed from ONLINE to UNINITIALIZED

2019-12-28 16:31:36.447 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:15f71b6bf6d' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2019-12-28 16:31:47.071 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:15f71b6bf6d' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING

2019-12-28 16:31:47.099 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:15f71b6bf6d' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE): Controller is offline

2019-12-28 16:31:47.299 [vent.ItemStateChangedEvent] - zwave_serial_zstick_15f673bb2bc_serial_can changed from 1 to 0

2019-12-28 16:31:57.912 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:15f71b6bf6d' changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to ONLINE

Rest is also not working, don’t know where to look here.