[Résolu] Restauration ou Migration de yunohost sur DD / [Solved] Restore or Migrate yunohost on a HDD

My YunoHost configuration

Hardware: internetcube (lime 1)
Internet access: ethernet at home

After my 32Go SD card has crashed, I’m trying to restore yunohost. I have a 4Go µSD and a HDD with sda8 available in ext4. My installation took 8Go on the previous SD card and it probably crashed because I installed a swap on it (lime 1, 512Mo).
I have several backups from the time the SD was stable. 3 full backups that weight between 300 and 900Mo and some app-pre-upgrade-backups. I also copied the content of the corrupted SD card as a backup but I don’t remember if it was before or after it crashed.

With the idea given in Transfert d'une instance Yunohost vers un nouveau serveur in mind, I followed these steps :

  1. Flash the SD card with yunohost jessie image without doing the post-installation following YunoHost • index until Etapes de configuration (not included)

  2. Move root directory on the sda8 of the HDD and keep \boot on SD card following
    howto:install_sata [Internet Cube]

  3. Copy my backups on /home/yunohost.backup/archives using https://yunohost.org/#/backup_fr

  4. Run
    yunohost backup restore 2018****-******

  5. Following [Résolu] Restauration error and Problème de restauration de sauvegarde suite à réinstallation - #8 by Jaxom99 I tried 4. again after apt install archivemount and get

Erreur : Archive de sauvegarde incorrecte

then I tried 4) after removing it and also removing apt remove fuse and I get

Attention : Le montage de l’archive de sauvegarde a échoué
Traceback (most recent call last):
File “/usr/bin/yunohost”, line 219, in
timeout=opts.timeout,
File “/usr/lib/python2.7/dist-packages/moulinette/init.py”, line 136, in cli
moulinette.run(args, output_as=output_as, password=password, timeout=timeout)
File “/usr/lib/python2.7/dist-packages/moulinette/interfaces/cli.py”, line 390, in run
ret = self.actionsmap.process(args, timeout=timeout)
File “/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py”, line 498, in process
return func(**arguments)
File “/usr/lib/moulinette/yunohost/backup.py”, line 2140, in backup_restore
restore_manager.mount()
File “/usr/lib/moulinette/yunohost/backup.py”, line 1025, in mount
self.method.mount(self)
File “/usr/lib/moulinette/yunohost/backup.py”, line 1788, in mount
tar.extract(‘info.json’, path=self.work_dir)
File “/usr/lib/python2.7/tarfile.py”, line 2098, in extract
tarinfo = self.getmember(member)
File “/usr/lib/python2.7/tarfile.py”, line 1819, in getmember
raise KeyError(“filename %r not found” % name)
KeyError: “filename ‘info.json’ not found”

I tried yunohost backup list and received

Erreur : YunoHost n’est pas ou pas correctement installé. Veuillez exécuter « yunohost tools postinstall »

If you can check your backup, inside it should contain an info.json file. extract this file and put it with your backup like this:

/home/yunohost.backup/archives/YOUR_BACKUP_NAME.tar.gz
/home/yunohost.backup/archives/YOUR_BACKUP_NAME.info.json

I extracted it with gnome archive manager but it says it’s corrupt. The folders apps, conf, data and hooks are properly extracted, but no info.json file. However I had saved the info.json files together with their archive at the time I backed up.

Is it possible that a full backup archive has less than 1Go when the space of my system used to be 8Go? Maybe the backups failed back then?

Finally I managed to apply a restore by extracting an archive .tar.gz, then recompressing the extracted folders and the corresponding info.json that was backed up along the archive.

It looks like some restoration works, I get the admin page but could not log in until now.
(Comme un boulet j’ai pris des captures d’écran au lieu de copier les lignes…)

First restore

Then, as the admin web interface didn’t work, I did a second restore that didn’t work either :

Any idea what part of the restore is failing and what could be done to get back the web admin and user interface?

Is it possible to get a copy of the new info.json that you created ?

I finally found an older backup that was not corrupt, and which restored my yunohost successfully. I then added a swap file located on /swapfile
All apps have not been restored successfully, but applying specific backups, or reinstalling them allowed me to recover a satisfying server.

So, in the end I followed these steps :

  1. Flash the SD card with yunohost jessie image without doing the post-installation following yunohost.org/#/installation_brique_fr 1 until Etapes de configuration (not included)

  2. Move root directory / on the sda8 of the HDD and keep /boot on SD card following
    https://wiki.labriqueinter.net/doku.php?id=howto:install_sata

  3. Copy my backups on /home/yunohost.backup/archives using https://yunohost.org/#/backup_fr

  4. Run yunohost backup restore 2018****-******

  5. Add a swap file on the disk following “the faster way” given in https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

  6. In case some apps have not been recovered successfully, apply some specific backup (pre-upgrade) or reinstall them.

1 Like