I have openhabian v.2.3.0-1 installed on RPI2 with no issues for nearly a year. I downloaded and installed a new openahbian image to a 128GB SSD that’s connected to a RPI3 B+. Before backing up my RPI2 install, I updated hoping it would be an easy swap over. Backup method used was “sudo openhab-cli backup”, copied over the zip file to the RPI3, then sudo openhab-cli restore. Prior to restoring on the RPI3 I ran a backup to allow the system to create the new backup directory then deleted just the zip file.
The RPI3 is working, I can connect via SSH and Samba, I have all rules, items, scripts…etc. Here is my problem (or will be in near future) I update via openhabian-config and get this:
Using sudo apt-get shows this:
I’ve checked /etc/apt/sources.list.d and all seems to be correct, /var/lib/dpkg/info/openhab2.prerm good also. If someone could point me in the right direction it would be greatly appreciated.
The errors indicate that your RPi3 either is not on your network (i.e. not properly configured to connect) or something else is wrong with the network configuration preventing it from resolving DNS names. Since you cna connect via SSH and Samba that implies the problem is with the DNS.
There is nothing that is done by the openHAB backup and restore scripts that would cause this problem. I don’t know enough about what openHABian does and what might have gone wrong there to mess up your DNS. But the source of the problem and the solution will probably lie outside of this forum. Look through the RPi forums searching specifically for “Could not resolve host” and see if you can figure out which file or setting got messed up.
Also review your router settings, particularly any firewall settings and make sure it isn’t blocking the RPi for some reason.
Ah, thanks for pointing me in the right direction, think I know what the issue is. I changed the local address on the new RPI3 to be what the old RPI2 was via “sudo ifconfig eth0 10.0.x.x netmask 255.255.255.0”. The DNS probably wants to know why the MAC has changed.
I was hoping by doing the above I wouldn’t have to change the IP on all my devices. I’ll do some reading, maybe I can change the MAC either on the RPI3, DNS, or router.
It is always a good idea to make these sorts of changes as close to the source as possible. If you can, assign IP addresses in your router’s DHCP server.
Problem solved, thanks for the tip Rich.
I had two options for changing the MAC, on the RPI3 https://www.raspberrypi.org/forums/viewtopic.php?t=171534 or via the router. I didn’t want two RPI’s with the same MAC in the future, so I made the change on the router. Reset the router, stopped openhab, rebooted the pi and all is good.
I read many articles on moving a setup from one device to another and thought I would give it a go. For anyone interested in what hardware was use (seem in most forums this can be an issue) RPI3 B+ with 5V 2.5A power supply, PNY CS900 SSD 120GB (bestbuy on sale $25) and a USB to SATA cable (amazon $12). Here is a link to the cable https://www.amazon.com/gp/product/B00HJZJI84/ref=oh_aui_detailpage_o07_s00?ie=UTF8&psc=1 lots of issues with using RPI3 with no SD card seemed to come from cable compatibility. I’m waiting on a 2.5" hard drive enclosure w/ USB cable connection, if it works I will edit and include a link.
Hard drive case came this morning, sooner than I thought, and it works great! I had no issues with the USB to SATA cable, it seemed to respond quicker than before (Note: I was on a RPI2 before). After shutting down, swapping connections, then restarting I can definitely see a difference in response. I know I’m limited to USB2.0 speed due to the RPI3 but I’m pleased with my new setup. Here’s the hard drive case w/cable info for anyone thinking about upgrading. (amazon $8.59)
BTW, clear the contents of /var/lib/openhab2/cache & /var/lib/openhab2/tmp before making and restoring to your new drive. Yes, it can be done after the restore but who wants unnecessary error logs