Automated restore of backup

I am building an automated installation of Home Assistant - with Supervisor
Most of the installation works just fine - but I am having issues restoring a backup during the process.

I am running the which installs Home Assistant just fine.
First issue is that the returns to my script before Home Assistant internal install is completed.

I handled this by checking “ha core check” and waiting for it to return “Command completed successfully.”

Now I copy my backup to the backups folder and run
ha backups reload
ha backups restore MYBACKUPNAME
This returns “Command completed successfully.”

Here comes the issue - the backup is not restored at all.
If I run the command manually (or restore from the UI) it works fine.
My guess is that Home Assistant is not ready for the restore just yet and I therefore need a better way to detect if the installation is complete than “ha core check”

Any thoughts?

untar the backup to /usr/share/hassio before running the

That does not seem to work - it looks like the files are just overwritten by the installer.

Strange. That is more or less how I install a new installation of Supervised : copy the contents of /usr/share/hassio over to a new vm, and then run the installer. An untar should be the same.

I will double check my setup.

I am currently only copying one file - configuration.yaml. Could that pose an issue?

Yes, it will not work without copying the hidden directories in the config folder.

It seems to work. Thanks for your help!