Backups corrupt no useable backups possible

Hi Everyone,

Did a restore test of my backups today, did find out that for nearly a month the backups are showing have right size but are not restoreable. Even worse, I am unable to extract any of the tar.gz in the backup.tar files. I tried every way and program I could find, tried 7zip winrar on windows, even gzrtl and several other linux archive tools, none have been able to extract a single file.

Has anyone experienced the same or any idea what could be the cause?

Any help is very much welcome, I realy do not know what to do anymore.

BR,
Christian

How were the backups created?

What errors are you getting when doing a restore?

Anything in the logs?

Never seen this myself, but you prompted me to test mine. I had no problem opening the tar file and its contents with 7zip.

Where are you saving your backup tar files? External at a minimum, offsite is better. Both is best.

Try making another full backup and open it with 7zip.

Are you using a passphrase? If so, you can’t open the backup with an extractor. Try making a manual backup without a passphrase and see, if you can extract and open that one.

If not, try enabling the debug mode for the backup integration and report back. :slight_smile:

Sometimes the download of the backups is done as a ASCII text and then certain characters are converted, like \r\n to \n or viceversa.

Make sure that your download is being done as a binary.
If you download it through a browser, then maybe try another browser, if you can not find the setting in the current browser.

1 Like

Hi guys,

Thanks a lot for the inputs. Sorry for my late reply, fell pretty ill and was unable to do anything. Just to sum up

Backups have been created with samba backup which is using basically same as internal backup function without password protection. I managed to get a backup from last month that was still ok. However that would have meant to lose a month of work and data.
I therefore resorted to my last idea of trying to restore the data on my ssd in the HA yellow. Do to my line of work I have some experience with that. I was quite lucky and was able to restore most of the configuration and of my sqlite db as well :slight_smile: First time the 500GB ssd was a good thing and nothing was overwritten to a point it was no longer recoverable.

After fresh installation and applying the configuration and db data again all is up and running. Also the backups created the same way as before are valid and work.

My problem is solved, with a lot of effort and swearing. I do not recommend this approache, make sure to test your backups on a frequent basis, as I will in future and for those that start fresh, my advise would be to use the recorder integration from day 1 to move your db to an external one not the internal sqlite. I will migrate that too as soon as I find a good way without a hugh dataloss.

Thanks and good luck too everyone.

1 Like

Are you using a passphrase? If so, you can’t open the backup with an extractor. Try making a manual backup without a passphrase and see, if you can extract and open that one.

If not, try enabling the debug mode for the backup integration and report back.

Was able to do that in past too. No passphrase is used btw. Backups are saved in 4 locations like all my stuff. Redundant at home in different places and geo redundant at the other side of my country. So they are save. A yes and my HA holds a copy too.

I can see exactly the same problem as you. Backup made onto a network drive. The backup accessed directly from there. Copied over to a Windows machine where I try to extract either with 7zip or the built in tool, but it cannot be.

I had to go back to the beginning of April 2024 to find a file which can be extracted.

What built-in tool?
Make a backup copy of your backup tar file then open it using 7-Zip.
Have you run 7Zip → test archive?
How are you copying the file and what error messages do you see?

1 Like

Windows 11 built in archive tool.

Yes, I am copying it to the Windows 11 machine. No error meesage there.

When I try to extract the homeassistant.tar.gz to get the homeassistant.tar I get the Data error in 7zip. And Fatal error with the Windows 11 tool.

How? Do you have the Samba Share add-on installed?

Wait! What?? The backup file is something like “3eb1c543.tar”. This is the file you open with 7-Zip to get to the individual files in the backup.

If all you want to do is a restore, just copy the tar files into your /config/backup folder then run restore from the Home Assistanr UI.

Nope, I use normal backup when I update things. And the backup location is a network share.

The backup file is as you described, a tar file containing a backup.json and a homeassistant.tar.gz, which extracts to homeassistant.tar if it succeeds. Which then contains all the files you described.

My current interest in the backup was to compare a file a few days ago to its current state.