Add-on: Home Assistant Google Drive Backup

Если их отключаю из интерфейса Домашний помощник по резервному копированию Google Диска , то после создания резервной копии, они сами не стартуют и приходится запускать вручную.

It sounds like you’re asking the addon to stop some other addons during backup, which won’t save any space. In fact I recommend you never stop any addons during a backup because it is almost never necessary. In this addon’s web interface you can select some addons or folders to exclude from backup, its in the addon’s settings under the heading “Partial Backups”. They’re called “partial” because you’re only backing up part of the Home Assistant files.

Below is a GPT3 translation, sorry if it comes out all weird:
Похоже, вы просите дополнение останавливать другие дополнения во время резервного копирования, что не сэкономит место. На самом деле я рекомендую никогда не отключать дополнения во время резервного копирования, потому что это почти никогда не нужно. В веб-интерфейсе этого дополнения вы можете выбрать некоторые дополнения или папки для исключения из резервной копии, они находятся в настройках дополнения под заголовком «Partial Backups». Они называются «Partial», потому что вы резервируете только часть файлов Home Assistant.

2 Likes

Thank you very much! Thanks to you, I figured it out

@sabeechen
What an excellent add-on, it did exactly what I was looking for!

Everything worked “out out the box”, thanks a million!

Cheers!

does anyone see this too:

sorry for the crosspost from the 2022.11 release topic. Its just that the add-on has been working since forever, and maybe the supervisor glitch the other day has corrupted anything?

My ISP has a restricted data volume and in addition my backups fill 75% from my Google Drive… so, I was wondering if there’s an option to keep daily backups local and only upload weekly and/or monthly backups to Google. Having the same backup local and in Google is somehow a redundancy I don’t need, I’d rather control which backups to keep local and which to upload… what are your thoughts or ideas?

it came back to life automagically after 2 days… however, I do notice a huge lag after restarting the instance. Has the always been the case? I mean, many minutes go by before the entities are settled, the left menu add-on Backup page shows fine. the entities are simply not created…

reloading the add-on does help a bit, and show:


but this also stays for a very long time. And all along, there’s nothing in the HA logs (level error)

add-on log:

11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/addons/self/info
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/info
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/core/info
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/supervisor/info
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/addons
11-23 10:47:37 INFO [backup.ui.uiserver] Starting server on port 8099
11-23 10:47:37 INFO [backup.ui.uiserver] Server started
11-23 10:47:37 DEBUG [backup.model.syncer] Sync requested by Coordinator
11-23 10:47:37 INFO [backup.model.coordinator] Syncing Backups
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/supervisor/info
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups/6a96501c/info
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups/930f1cce/info
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups/93e01420/info
11-23 10:47:37 DEBUG [backup.ha.harequests] Making Hassio request: http://supervisor/backups/669dab1e/info
11-23 10:47:37 DEBUG [backup.drive.driverequests] Requesting refreshed Google Drive credentials
11-23 10:47:37 DEBUG [backup.drive.driverequests] Making Google Drive request: https://www.googleapis.com/drive/v3/files/1-aKy5WqjMxR8TncEGlwy1xm362frZzdx/?fields=id%2Cname%2CappProperties%2Csize%2Ctrashed%2CmimeType%2CmodifiedTime%2Ccapabilities%2Cparents%2CdriveId&supportsAllDrives=true
11-23 10:47:38 DEBUG [backup.drive.driverequests] Making Google Drive request: https://www.googleapis.com/drive/v3/about?fields=storageQuota%2Cuser
11-23 10:47:38 DEBUG [backup.drive.driverequests] Making Google Drive request: https://www.googleapis.com/drive/v3/files/?q=%271-aKy5WqjMxR8TncEGlwy1xm362frZzdx%27+in+parents&fields=nextPageToken%2Cfiles%28id%2Cname%2CappProperties%2Csize%2Ctrashed%2CmimeType%2CmodifiedTime%2Ccapabilities%2Cparents%2CdriveId%29&pageSize=100&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=allDrives

Update

an issue is open in the Google Drive Backup repo: Unable to back up shows pending · Issue #751 · sabeechen/hassio-google-drive-backup · GitHub

Hi all, probably totally stupid question but I haven’t been able to find a simple answer… I have the addon running fine, does exactly what it says on the tin, everything perfect. Now I would like to change the Drive backup location to another account (the current Drive is getting full with other stuff and I have another one that has ample space). What is the easiest way to achieve this - just reauthorize? Would I have to move the backups on the current Drive to the other Drive?
Again, probably the solution is dead easy but I don’t want to mess anything up… TIA.

Just reathorize with the new account. It will create a folder and re-upload any backups you have in Home Assistant into Google Drive.

There isn’t currently any easy way to migrate backups between account swithout re-uploading them, which is a limitation imposed by the reduced permissions the addon request for interacting with Google Drive.

If you have backups from the old account in Google Drive, they aren’t in Home Assistant, and you want those old backups to show up in the UI with the new account, here is what you’d have to do (warning: its tedious):

  • Authorize the addon with the new account, any backups you have already in Home Assistant should get uploaded to google drive so wait for that to finish.
  • Make sure the “Ignore other backups” setting is turned on and “Delete Ignored Backups After…” is blank in the addon web-ui.
  • Download the backups you have in Google Drive from the old account onto your local computer.
  • Then for each backup:
    1. Upload the backup using Home Assistant’s backup UI, eg Settings > System > Backups > > Upload Backup
    2. In the Addon’s web ui, click the “ignored” backup you just selected and choose “Don’t Ignore”
    3. In the addon’s web-ui, click Actions > Sync Now, which will upload the backup to Google Drive
    4. Click the backup again, snd select “Delete” from Home Assistant.

So its doable just very manual and tedious, especially if you don’t have enough space in Home assistant to store more than a few backups. Its much easier if all you want to do is upload the backups you already have in home Assistant to Google drive

Thanks Stephen for the fast reaction! Copying older backups is not really necessary so I will just reauthorize with the other account, as you suggest. Thanks again.

Hello, i have an issue starting the addon.

Yesterday i installed and setup the addon, no problem, then i had an unrelated issue and had to restore my backup, from before i installed this addon.

Then i tried to reinstall the addon, and now i cant start it, the only log entry i get, is this:

12-09 12:41:59 INFO Starting server on port 8099
12-09 12:41:59 INFO Server started
12-09 12:41:59 INFO Syncing Backups

but nothing happens when i click start confused:

If you see that output in the logs, then the addon is definitely running. I’ve seen some users report this before. I don’t have a solid idea of what causes it and I’ve never had it happen on any of my test machines so I’ve never been able to dig into whats going on.

My best guess is that there is some bug in Home Assistant (the supervisor specifically) where it misreports a started addon as stopped. When you click start it sees the addon running and does nothing, and because the UI thinks its stopped you don’t get a button to stop it. I’ve had users resolve it by:

  1. Using CRTL+F5 to refresh the page (which suggests its a browser cache problem)
  2. Rebooting the home assistant machine (which forces the add-on’s container to restart with the machine)
2 Likes

New to HA. Just installed the HA Google Drive Backup. All good until I attempt to Authenticate with Google. I select my account, get a question do I want to continue, I select continue and then get a screen stating “something went wrong”. Hit the next button and I am sent to my Google Account.
Ah - what is wrong? I do have 2FA set on the account.
Your help pls - thanks.

Well, thinking 2FA on google was causing the problem, but turned 2FA off, tried to authenticate and got the same results. So turned 2FA back on for Google.

Your help pls. Thanks.

Sensational Add-on. Thanks for taking the time to develop it.

2FA shouldn’t change anything (I use it too with no problem). Most likely there is something unique about your Google account or browser that prevents the authentication from happening.

  1. Is the website where you see the error from Google or is it from the addon, eg is it a *.google.com domain at the top of the page or is it https://habackup.io?
  2. Ensure you allow authentication from third-parties for your account by going to:
    https://account.google.com (Logged in) > Security > Manage Third-party Access > Google Account sign-in prompts (enabled)
  3. If you have any software installed on your computer or network that could interfere with cookies or javascript (ad block, “enhanced tracking protection” in firefox, javascript rewriters, etc) consider turning them off just for the authentication. Google’s authentication workflow makes heavy use of cookies, redirects, and other things that are frowned on by those mindful of privacy. Best would be to use a stock chrome or edge browser.

If all else fails you can try creating a new Google account and authenticate with that. If that works its definitely a problem with your account specifically, if not then its probably a problem with your browser.

And if that also fails to point toward the problem you can consider authenticating by using custom credentials, which is tedious but avoids using any of the services I own for authentication (in case they’re the problem).

for item one: the web site giving the error is: Sign in - Google Accounts
for item two: confirmed Google Account sign-in prompts is enabled.

for item three - that would take some time to figure out. So in the short term, I when from the Chrome browser and started Firefox, logged into HA, and went through the process to establish your addon. WORKED JUST AS ADVERTISED!
So - yes, something in the chrome browser - most likely some “addon/extension” I am using that attempts to help block cookies, etc…and I admit I have a few.

so - basically - problem solved - YA !!

Long term, I need to figure out what is causing the problem. But, my immediate need is resolved !

Many, Many thanks!

Happy holidays and stay safe!!

Hi!
I have over 1900 ignored backups due to some error in the new Core Matter Server. This addons slows down a lot because of that. I already removed the backup files from the backup folder in Home Assistant, but this add=on still shows that there are 1900+ ignored backups. Is there a way to delete this so that this addon performs well again?

Heh, thats a problem I hadn’t considered. I suspect that if you restart the addon it will recover if you give it a minute or so, but make sure Home Assistant also doesn’t think the backups are still there, they should be gone from the page at “Settings” > “System” > “Backups” in the Home Assistant UI. If not you need to tell Home Assistant to refresh its cache in the upper right of that page. Or just restart the whole machine.

First off this addon is great and I’ve never had issues until now and even then it’s not too big of one.
So once it hits around 90% usage in Drive it says it’s full and can’t make a backup. Is this something calculated on your end or do you get a response from Drive saying it’s full early? Idk really how the API works so I’m not too sure if you calculate the backup size before to make sure there’s enough room? Too many idea’s I can think on how it could work for this lol