Backup/restore issues

I wanted to restore my OH3.4 from a backup because I had some problems with Miele cloud binding. I use backup.bat batch file located in c:\openhab\runtime\bin folder to backup my OH during every night. In addition to this, I’m using SyncBackFree software to backup the whole openhab folder to my Synology NAS. This backup is also done every night.

At first I used the restore.bat batch file also located in the bin folder. Once restoring was completed I noticed that all the persistence data was lost. I then copied the last backup from my NAS to openhab folder on my OH server. This didn’t restore the persistence data either. I noticed that last data is from September 2022 when I screwed up my OH last time.

I’m using RRD4j persistence service so I’m now wondering why neither of my backup methods didn’t restore the persistence data. One thing which I’m also wondering is that the zip-files created with backup.bat file are really small in size, only ~20MB in size, whereas the size of the openhab folder on my server is ~5GB so the backup made with the batch-file doesn’t obviously backup the persistence data. I also checked that SyncBackFree copies the updated files to the NAS correctly.

So, I’m wondering whether my persistence data is lost forever.

In case the RRD4J files are not contained in the zip file and you deleted the files from your box and they are also not included in the SyncBackFree backup then they are gone.
I just had a look into a zip file created by the OH backup tool and the RRD4J files are included here.

As neither the zip file nor SyncBackFree was backing up the files I have the impression that you disabled RRD4J persistence.

OK, thanks. It seems that the rrd-files are not in the the zip-files. I have used the backup.bat batch-file located in c:\openhab\runtime\bin folder. I wonder whether you use this batch file for making backups.

I have now realised that SyncBackFree doesn’t copy those files which have same attributes. The rrd-files seem to have their date when they were created and the size doesn’t seem to change either so therefore SyncBack ignored them. Somewhat annoying that you learn some things only by mistake.

I am not running it in a windows environment but on a pi.
Functionality is the same.

Either that is specific to windows ( date does not change ) or the content was not changed.
In windows file explorer you can change/add the columns content to be shown. There it is possible to distinguish between date of creation and date of last change as far as I remember.
Just checked in my environment and there I see that the changed files show today’s date.

that is the nature of the rrd format. See e.g. RRDtool - Wikipedia

Many thanks for your help. I have learned new things about rrd-files so I need to setup somehow the backup. I checked the Syncback forum but there was nothing about rrd files. Somewhat strange that the backup tool in OH is working differently in windows and in a pi.

I downloaded and checked ( with regard to code content ) the windows version of the backup tool.
It creates a backup of the userdata folder which is the same functionality that also the linux/pi backup tool provides. The userdata folder is the folder that is one level above the persistence folder - the name of the folder may be different. So if the userdata folder is backed up then also the persistence folder with rrd data is backed up.

Wolfgang,

Many thanks for testing the windows version. I think I know now what is going on with my system. I ran the batch file without any parameters so it created a zip-file under c:\openhab\backups folder. I opened it with windows explorer and it has a persistence folder with rrd4j data and all the rrd-files are there. I then opened the same zip-file under WinNc explorer (see screen copy below). Both panels show opened zip-file (on the left the zip file on c:\openhab\backups folder, on the right the zip file on my NAS). For some reason WinNc doesn’t show the persistence folder at all so this confused me completely. Luckily I could restore rrd-files from March 31 zip file so I lost only few days data.

1 Like