Over the past few weeks, I have built a fairly large OpenHAB 3.3 system on my Windows PC. I now want to migrate it to a Raspberry Pi 4 running OpenHabian. This has become a frustrating experience as nothing I have tried has worked. Before anyone asks, I have read the documentation, searched on the community and looked at a number of videos. This is where I am now.
OpenHAB 3.3 is fully configured and works on my PC.
I have flashed an image of openHABian v.17.3 onto a 64Gbyte SD card with Etcher. This will boot correctly on the Pi and give me a working, but unconfigured openHAB server, so I know that the hardware and my network are both working correctly.
1. Using Initial Configuration.
My first approach was to make an initialisation zip (initial.zip) and place it on the boot partition of the SD card as outlined in the documentation.
Initial configuration
You can have openHABian import a working openHAB configuration right from the start at installation time like when you migrate or reinstall: make the initialconfig
parameter point to either a file or URL. Note that you can only place config zipfiles on the 1st (Windows) partition, and that partition will finally be accessible as /boot
. So a filename would need to be /boot/xxx.zip
. Default is /boot/initial.zip
. So if you have a openHAB configuration backup zipfile (created e.g. by using menu option 50), put it to the E: device that the first partition of your SD card shows up as on a Windows PC and change its name to 'initial.zip
My assumption from reading other posts is that the initial.zip file should contain both USERDATA and CONFIG directories. When I zip up these two directoreis, I get an initial.zip file which is 460MBytes in size. When I try to write this file to the 1st (Windows) partition, I get an error message because the boot partition is only 256MByutes in total of which 50MBtes is already used.
I have tried reformatting the SD card under windows to create a 2GByte initial partition, but Etcher ignores this and reduces it to 256 Mbytes. I have also the Raspberry Pi Imager which loads openHABian correctly, but again the 1st partition is only 256MBytes so I cannot write the initial.zip file to it. As I can see no way of creating a larger partition, this is a dead end
2. Using cli backup
On my Windows system, I used a console session to try to run the openhab-config tool to create a backup file that I could move with WinSCP to the Pi. I started the console with the default username (openhab) and password (habopen).
This is the console;
What password do I use? I have used “habopen”, “openhabian” and my administrator password for the windows OpenHAB server, but none work.
3. Create a backup using a zip tool.
On the Pi running openHABian, I can use PUTTY to access the console. I can now run
sudo openhabian-config
with password “openhabian” to open the Configuration Menue. I can now use option 50 to create a new backup file
/var/lib/openhab/backups/openhab-backup-22_11_09-14_38_01.zip.
I the used WinSCP to copy the file back to the PC. So far so good. I have already created a initial.zip file which I could copy back to the same directory on the Pi. However if I try this I get the following error
So I cannot write the backup file to the Pi.
Can anyone help to find a way through this. It strikes me that the migration of a system from a development machine to another for deployment should be simple. What am I missing.
PJG