Can I restore Yunohost 11.3.0.2 to a server with Debian 12 and then do the migration?

What type of hardware are you using: Virtual machine
What YunoHost version are you running: 11.3.0.2 (stable)
How are you able to access your server: SSH

Describe your issue

I am having this issue Toasted server: Migration 0027_migrate_to_bookworm did not complete - basically I cannot run the YNH migration since the server we have is a container and some updates fail, possibly because we do not have full control/access over the server and the network config fails to update. Anyway there seems to be no solution other than buying a new VPS, but most only provide them with Debian 12.

Is it possible to restore the Yunohost 11.3.0.2 on a Debian 12 server and then run the migration?

Share relevant logs or error messages

CLARIFICATION:

Hm maybe I got a bit confused. I mean to install the latest Yunohost on a Debian 12 server, then restore my backups like the YNH config and users…if that would be ok. Considering these backups were made on Debian 11 with YNH 11.3.0.2

No, you can’t directly.
Try restoring in a local vm, make the migration, make a backup then use it to restore in the production server

Oh…@aleks said that it should work Toasted server: Migration 0027_migrate_to_bookworm did not complete - #9 by Aleks - now I am unsure. But the VM idea I didn’t think before. Hm…should try that first. Thanks!

Oh well yet another issue. I cannot install the latest YNH with curl https://install.yunohost.org | bash on Debian 11 since it requires Debian 12…damn. Is there a way to grab the latest Debian 11 YNH package?

1 Like

Just for the sake of it I tried installing the latest Yunohost on Debian 12. Then tried to restore the conf backup from the old Yunohost on Debian 11 and I got this nasty error:

Could not load info for archive '/home/yunohost.backup/archives/auto_conf.tar'… The info.json file cannot be retrieved (or is not a valid json).

I wonder if this is related to his Borg Restore Backup file without info.json - #9 by NoCodeOnlyIssues

Or could it be that the .json files from YNH Deb11 are not compatible with those from YNH Deb12. Or is Borg broken…?!

Hmmmyeah i don’t remember the full story about this, but i seem to recall that the info.json is in fact in the tar archive but somehow yunohost can’t pick it up because of some technicality … are you able to manually extract it from the archive maybe ? And put it on the side with the same name as the .tar, something like auto_conf.info.json ?

Yes that’s exactly what I did. Put it in the same folder, and it has the same name as the .tar. Plus 0644 permissions that I see all backups for YNH have… I am now confused since idk if this is a Borg issue or not. But I will try to grab a backup directly from the old server, done with Yunohost, and see if that works.

For those who may wonder about extracting the .json and renaming it:

Extract the .json file from the archive (rename the archive with the one you want):

tar -xvf /home/yunohost.backup/archives/auto_conf.tar -C /home/yunohost.backup/archives --strip-components=4 home/yunohost.backup/tmp/auto_conf/info.json

Rename the .json file to the archive name:

mv /home/yunohost.backup/archives/info.json /home/yunohost.backup/archives/auto_conf.info.json

Well bad news indeed…I tried to use a backup archive from Borg from a Debian 12 and latest YNH stable and same error. It means that the Borg backups are broken and that’s quite scary.

Can some of you reopen this thread Borg Restore Backup file without info.json - #9 by NoCodeOnlyIssues to try and fix it? I can try to debug/test, idk…

The issue is reported here Borg Backup Restore procedure is not working · Issue #181 · YunoHost-Apps/borg_ynh · GitHub so I will continue there.

I found a solution for the Borg Backups that may allow me to restore my system on a Debian 12 install Borg Backup Restore procedure is not working · Issue #181 · YunoHost-Apps/borg_ynh · GitHub - but I cannot do this manually for all backups…so I need help. Maybe a fix for Borg or how YNH handles the backups.

As for my initial question about restoring the old ynh backups to the new debian 12 ynh I managed to restore the configs (users, etc.) but I see errors when for example try to change a password for a user

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/moulinette/interfaces/api.py", line 473, in process
    ret = self.actionsmap.process(arguments, timeout=30, route=_route)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 561, in process
    return func(**arguments)
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 486, in func_wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/yunohost/user.py", line 579, in user_update
    app_ssowatconf()
  File "/usr/lib/python3/dist-packages/yunohost/app.py", line 1759, in app_ssowatconf
    app_portal_domain = next(
                        ^^^^^
StopIteration

I guess it is a bad idea to do it like that…I’ll try what @jarod5001 suggested.

Ok I am testing in a VM. I installed Debian 11 then did curl https://install.yunohost.org/bullseye | bash - restored successfully the config and data files. All but the apps. However I see no migration to do. I updated the YNH system and all that.

$ sudo yunohost tools update
$ sudo yunohost tools upgrade system
$ sudo yunohost tools migrations run

Nothing… I get a message: Info: No migrations to run.

The YNH version is 11.3.0.2 (stable)

Ok so I did it. I will post here in case others face the same situation.

  1. I made backups for all of the apps and the YNH install with Borg.
  2. I bought a dedicated server from Hetzner who still provides Debian 11 images.
  3. I installed the older YNH there with curl https://install.yunohost.org/bullseye | bash
  4. Installed Borg, connected to Borgbase where my backups were.
  5. Restored all backups from BorgBase.
  6. Go to /etc/yunohost/migrations.yml and if the migration to Bookworm is set as “skipped” edit it and add “pending”. Else YNH thinks there is no migration to do.
  7. Go to the YNH admin and run the updates and migrations.
  8. After all is done, voilla, you have the new YNH and Debian 12 running.

I also moved them back to Webdock (hosting) after the migration.

But well this is how I fixed it.