Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resorting of backup did not work #153

Open
rocky-III opened this issue Aug 10, 2023 · 3 comments
Open

resorting of backup did not work #153

rocky-III opened this issue Aug 10, 2023 · 3 comments

Comments

@rocky-III
Copy link
Contributor

After a not correct working update and deleting of the HZ App - the resorting of the backup did not work

WARNING - /var/cache/yunohost/app_tmp_work_dirs/app_mvszbjej/restore: line 30: db_user: unbound variable

https://paste.yunohost.org/raw/elejoviheb

@ericgaspar please have a look and help... hope my Hub is not lost

Thanks so much

@rocky-III
Copy link
Contributor Author

I will try to install the backup manualy - after i unpacked the .tar file.

By my try to unpack the .tar archive manual locally on the server with

tar -xvf archives/hubzilla-8.0.tar -C hz-save

i stated a process which is running now since 10 hours -

would be

tar -xf archives/hubzilla-8.0.tar -C hz-save

quid faster ?

@dragondaddy
Copy link
Contributor

You probably don't need to extract the full archive. I think that if you could edit the script/restore file, and remove line 30 (ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd). If you're able to do that, maybe you'll be able to restore to your backup.

@rocky-III
Copy link
Contributor Author

rocky-III commented Aug 15, 2023

thanks - that was that good hint... still it was harder than i thought

Took me a while to understand how to do it but now i found a fix.

During the YNH backup process somehow the variable "db_user" was not stored - it is missing in the file "settings.yml" where all the variables are stored in for restoring a YNH app backup file

So here is what i did and what you can try if you came in to a similar situation:


YNH App backup archives are stored in /home/yunohost.backup/archives/

With your SFTP client make a save copy of your not working backup archive to your local hard drive - just in case...

Rename the backup archive on your server from "hubzilla-pre-upgrade2.tar" to something like "hubzilla-save.tar" so that YNH will not overwrite this archive by any other backup operation.

Go by ssh to /home/yunohost.backup

$ cd /home/yunohost.backup/

extract the file "settings.yml" from the backup .tar archive

$ tar -xf archives/hubzilla-save.tar apps/hubzilla/settings/settings.yml

(all this tar commands will take a while, depending how large your archive is, so be patient till the operation is done)

You find the extracted file under /home/yunohost.backup/apps/hubzilla/settings/settings.yml

Edit the extracted file "settings.yml" by adding the line "db_user: hubzilla" and save the file.
My SFTP client can do this within the app. If your SFTP Client can't do this you have to first download the file, use a text editor for editing, and upload it again by FTP.

Delete the original file "settings.yml" whin the .tar achieve

$ tar --delete -f archives/hubzilla-save.tar apps/hubzilla/settings/settings.yml

add the new edited file "settings.yml" to the .tar achiv

$ tar -uf archives/hubzilla-save.tar apps/hubzilla/settings/settings.yml

Now the YNH restore script can find the variable "$db_user" the and the restoring of the backup archive will work. Just select the renamed archive in the YNH webAdmin interface

or do in this case (archivename = hubzilla-save ) by command line

$ yunohost backup restore hubzilla-save --apps hubzilla --debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants