Migrate OH from Windows to OpenHABian

Tags: #<Tag:0x00007efed8e453d0>

First, I’am first class newbie in the Linux world :slightly_smiling_face:
I’am trying to migrate my Window 10 OH 2.4 system to a fresh OpenHABian 2.5 system running on a RP 4 (4Gb). Downloaded the latest 1.6 image and got a basic system up and running after an hour trail and error. So far, so good. Now I want to move my windows production system to the RP via backup. No problem to make a backup.zip file in windows and then copy that file to “var/lib/openhab2/backups”. Then I start “openhab-cli restore” and get this error:
“… appears to use backslashes as path separators. Unable to unzip…”.
Anyway to solve this problem?

So far I have not heard about such a problem. In my job I also get zipped files from windows system but haven’t seen that error before.
What is the output of ( it is a lower case letter L after 7z ) this command on the linux system:

7z l yourzipfilehere.zip

You may have a look at https://superuser.com/questions/1382839/zip-files-expand-with-backslashes-on-linux-no-subdirectories. Not sure if that helps.

This is the output on linux:

[11:48:44] openhabian@openHABianDevice:/var/lib/openhab2$ sudo openhab-cli restore /var/lib/openhab2/backups/openhab2-backup-20_10_31-10_40_32.zip

##########################################
openHAB 2.x.x restore script
##########################################

Using ‘/etc/openhab2’ as conf folder…
Using ‘/var/lib/openhab2’ as userdata folder…
Making Temporary Directory
Extracting zip file to temporary folder.
warning: /var/lib/openhab2/backups/openhab2-backup-20_10_31-10_40_32.zip appears to use backslashes as path separators
Unable to unzip /var/lib/openhab2/backups/openhab2-backup-20_10_31-10_40_32.zip, Aborting…

WHile I recognize it would be nice to have the restore script fully function. One thing you could do is unzip the file on windows and manually copy the files into the correct directory in openhabian. You could use winscp to copy them over or copy to the shared directories if you have that setup.
You would most likely need to run the fix permission menus item in openhabian after doing this but it would be an option to get you going.

Ok, i will try the “copy file” workaround but i’am not sure about “run the fix permission menus” , a command or?

THere is a fix permissions option in openhabian config menu.

I solved the backslash issue by unzipping the file to a folder then rezipping it using winrar. Sorted out the backslashes which apparently are created by a bug in windows powershell. I too am no linux expert but it worked for me.

1 Like

The copy file and fix permissions scrip worked. Now I am up and running. Thanks

1 Like

GReat to hear!