[SOLVED] Backup

Now when I have done my first configuration in paper UI and everything is working fine, I really want to save everything.

I use a PI and is doing my config on windows 10.

So what files do I need to save, let say if the PI goes down and I need to replace it?

From the command line type:

openhab-cli backup

Then move the .zipped backup file from /var/lib/openhab2/backups to your PC or somewhere other than RPI.

To restore OH from the backup place the zipped file in /var/liv/openhab2/backups and type this at the command line.

sudo systemclt stop openhab2.service

openhab-cli restore /var/lib/openhab2/backups (or use path to your backup if different)

sudo systemclt start openhab2.service

2 Likes

Hi @Johan_J hope this helps backups are super important and theres prob a few different ways you can do it

When i first started using openhab i followed a youtube guide and just left it running it backed up config files automatically and worked perfectly (along with pulling the card and making weekly images) but now i have been using OH for a longer period i moved over too Amanda Backup as it offeres live full sd image backup

are you using Openhabian? Amanda is built into it pretty easy too setup

Here is the method i first used

Another good option for a beginner

shutdown openhab and pull the memory card put it into a mem reader and use a program too completly image the card if card fails or you screw up you can always reflash the card using the image you created this would contain everything you have done

use something like

1 Like

Wow thanks!
Very impressed with the quality of the answers!

1 Like

No worries I’m glad it helped you will find the rest of the community the same too they have certainly helped me alot

1 Like

Agreed important and several way to accomplish this.

Here’s the readme on how easy Amanda is to setup. https://github.com/openhab/openhabian/blob/master/docs/openhabian-amanda.md May your Unix skills be with you.:laughing:

Jokes aside, this is a good way to backup your OH server but if never using Amanda before then reserve an hour or so for reading up.

Making a clone of your SD card from time to time is never a bad idea, but takes more time than other methods. Here’s a multi-platform tutorial to clone, compress, and restore from SD card. https://beebom.com/how-clone-raspberry-pi-sd-card-windows-linux-macos/

Whatever your method for backing up just make sure you can restore from your backup.

2 Likes

That doc makes Amanda look scary so does alot of other docs around here if I’m honest (too people new too OH text config, code, Linux ect)

Im still pretty new to os’s other than windows and still found Amanda easy too setup after a few vids n posts from here deffinitly not a first time begginers thing tho with so many other things too get running

@Johan_J

Make a full sd clone when you make major changes and follow the example in the video too backup other files

Seriously consider moving too text files it looked impossible when I started but makes life alot easier good luck with OH :slight_smile: and welcome too the community

1 Like

That was the purpose of using openhab-cli backup, it’s easy and works without having to reading a book.:wink: You can always improve your backup strategy later, just make sure you have one A.S.A.P.:grinning:

@H102
I just personally think an automated backup is better than a manual backup

people are lazy :wink: (that’s why we like smart homes and automation :D)

that’s why I used the video version for quite awhile

If you have made changes and forgot too backup :frowning: bad times

FYI: Amanda is not the only way to automate OH backups.

@Sharpy what do you run OH on?

@H102

When I first started I was running on a win 10 Machine had a good experience but quickly learned all the guides are for Linux so struggled too get much done. So now I’m running on a rpi 3 B+ that I’m very happy with it runs OH just fine (and have also learned about RPI because of this and quickly grabbed another for libreELEC)

But I’m thinking about moving too a Linux Vm on my Vm server at some point for more performance with better TTS (currently using pico tts but it’s sounds pretty bad need more human voice :))

What are you running OH on?

Hi all just want to confirm what exactly is this backup does?

will it backup addons ?
will it back things?
Items ?

i have some created by paper UI
some created by text files…

will it cover it all ?

1 Like

The information about installed addons is backuped, but not the addons itself, so when installing openhab2 new, the actual version of the bindings will be installed.
The only things to backup in addition, are the manually installed addons.

That last sentence I think is what you wanted to know.

1 Like

Where is this located (/var/lib/openhab2/backups) and how do I access it ?

What are you running OH on and how did you install it?

If installed using openhabian image then your backup will be stored in a zip file. To access this file use cd /var/lib/openhab2/backups this will move you to the current directory. To see the files in this directory use ls -al. You could also use ls -al var/lib/openhab2/backups to see what’s in the directory without actually moving to the directory.

This file will be empty unless you have use this command sudo openhab-cli backup --full to create a backup. You do not necessarily need the “–full” at the end it’s just my preference. With --full the zip file will be around 80m in size, but this will vary depending on how many files, bindings, etc… you have.

BTW, you must type this from the command line after connecting via ssh.

How do I move the zipped backup file to my PC ?

use google search, e.g. search for „copy files from pi to pc“.

1 Like

I use Filezilla for this and you may need to change file permission before transferred sudo chmod a+rw backups. To change back permissions sudo chmod a-rw backups.

Filezilla, nice that brings back some memories of using it in the past, thank you