Unable to restore some apps during migration to new server - app data on external disk

My YunoHost server

Hardware: Proxmox VE 8
YunoHost version: 11.2.5
I have access to my server : Through SSH & through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain:
I created a local backup on Server A, created a second yunohost instance on Proxmox VE (Server B). Used filezilla to move the backup.tar files from Server A to Server B. Used ssh backup restore command to restore the backup

Description of my issue

I had several apps that i was unable to restore because of a failure in the restore script.

For example, for the first attempt of restoring addguardhome, i the error was

2023-11-10 08:29:33,310: WARNING - Exception: Original path for "/var/www/adguardhome" not found

Full log here: Full yunopaste log

As that was the only piece of evidence i could find i manually recreated /var/www/adguardhome and received a different error:

2023-11-10 09:04:02,024: WARNING - There is already a directory: /var/www/adguardhome

Full yunopaste logs

Now, i’m not sure what i should do. I still have access to both servers so i can tinker but would like some idea of what might be preventing me from restoring several apps including:

  • Addguardhome
  • Bookstack
  • Dokuwiki
  • Firefly-ii
  • Firefly-iii Data Importer
  • Jellyfin
  • Qbittorrent

Thank you

Welcome !

It looks like /var/www/adguardhome is missing from the backup. Can you open and browse in the tar file to check that?

You will need to delete the directory you created.

Ahh. I think because i moved the data to an external drive on the original server the new server can’t find it. The backup has these app’s data in a mnt/hdd/var/www/adguardhome directory!

With this information, Do you think I could temporarily add an external drive to my new system, mount it at /mnt/hdd and let the restoration take place. And then from there move the files back into the yunohost.app on the main drive?

Oh, that’s interesting. The backup system requested to backup /var/www/adguardhome but since you had mounted the directory elsewhere… am I correct to assume you used a symlink to have /var point to /mnt//hdd/var? Or an other means ?

In any case the system followed the real path and stored it in the backup file, though the restore script still expects to find data in var/www/adguardhome, not mnt/hdd/var/www/adguardhome.

To fix that, I would rather untar, move the directory, and edit the csv file to fix the paths for restoration. Tar again and try again.

Depending on how you mounted the external drive, I’ll draft up a bug report.

Thanks for the advice, i’ll give it a go!

I used a symbolic link ln -s command when i moved the data to my external hard drive.

1 Like

Thank you @tituspijean for your suggestion. I initially tried to decompress the tar, edit the file paths and the backup.csv and then compressed the directory to a tar file.

For example, i moved the adguardhome directory from mnt/hdd/var/www/ to var/www/

After trying this option twice, it did not work. The new yunohost server could not find the directory.

What worked for me

  1. I did a fresh backup (to be safe)
  2. I removed apps from Server A (old server) that i had tested on Server B (new server) that i knew worked. I removed some of these apps on Server A in order to get disk space on the main disk.
  3. I then moved files from the external drive back to the main disk.

Moving files from external disk to main disk
I had some issues with this. First, i could not copy the files back because of the symlink. When i tried to rm the systemlink i couldn’t seem to find the name to remove.
I tried to identify symlinks in each directory using find /mnt/hdd/var/www/adguardhome -xtype l but cli returned nothing.

In order to remove the symlink i used ls -la /var/www/ | grep "\->"

From here i used mv to move the app directories from /mnt/hdd/var/www/ to /var/www/.

Next, i ensured the permissions were correct by running chgrp and chmod g+rx for the right user for the new directory.

  1. After this on Server A i used the backup tool to create a backup for just those apps and moved the backup files to Server B.
  2. I used the backup tool on Server B to restore the backup and it worked!

Note: the only reason i was so comfortable deleting apps and messing about with permissions and directory structures was because i had appropriate backups, and a second server in case things broke. Everyone should have redundancy before doing this

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.