Copying files from a pi3 to a pi 4

I have been trying for the last couple of weeks now to migrate all my files from a working PI3 running OH to a PI4. only went to a pi 4 so i could us an SSD. i have managed to copy what i thought was all of the files, but i cant seem to get the python rules to work. Is there a program or line of code that i can use that will just copy everything?

What would you like to copy ? What does everything mean ?
Files that you created/edited; installed; system related files ?
You can use scp to recursively copy files from one to another system.
You can use the tar command to tar a directory, its subdirectories and files into a file and copy this tar file to another system and untar it there.
You can use openhab-cli to create a backup of your openhab confguration.

The system itself only has to be copied offline as long as PI3 and PI4 are compatible.
I once used clonezilla to clone a SD card installation to a harddisk ( not openhab related ).

1 Like

Same versions of openHAB on both?

I performed a backup and restore to go from the PI3 to the PI4 using the OH, but there was things that it didn’t copy. I have gone in with VS code and copied the remaining files over but i must have missed something. I just thought that there would be a copy all function to make life easier. The OH looks like it works from the outside, but it wont run the rules that work on the PI3 in Python.

yes. both are running up to date versions when i did a backup and restore

For further description of scp you may look at But before destroying more than fixing I would try to analyze what really is missing.
So do you get any error message from the rule ? In case something is missing from the python stuff there must be an error message.
To check if you have everything under a specific directorz like /etc /usr … you can run e.g.

find /etc -type f

to get a list of all files ( under /etc in the above example ).
Redirect the output to a text file. Do that on both system. Copy one of the files to the other system then do a diff

diff TextFileA.txt TextFileB.txt | more

The output will show files that are on one or the other system.

1 Like

32 bit vs 64 bit OS? That might require different binaries.

The PI4 tries to run the ‘home.rules’ file, even though the ‘’ filer is where the the PI3 rule is. I thought that there might be something with the config file or a startup file, but they look the same. I have been trying to contact the person that helped me with the rules in the first place, but he isn’t responding

It doesn’t look like you have a development background. This will be tricky. I would suggest to first ensure that OpenHab is running properly on the new PI (e.g. go to the Paper UI). The second step is to ensure that it can execute a simple Python rule. The next step is what wolfgang_S suggested.

No. I don’t have that sort of background. i can see things mechanically and build just about anything, but this programming is still foreign to me. I can make my own basic components and write fairly simple rules, but its really frustrating the heck out of me why i cant get the python rule engine to work. i have re-installed the add-on, re-copied over the OH helper libraries, and it still does not want to play ball.

The only part that does not work is the rules based on python code ?
As far as I remember the helper libraries documentation contains a “hello world” rule that can be used to check if the installation is correct.
Did you try that one - if not could you give it a try ?

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.