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

Draft: Bullseye->Bookworm migration #1759

Merged
merged 13 commits into from
Jul 8, 2024
Merged

Draft: Bullseye->Bookworm migration #1759

merged 13 commits into from
Jul 8, 2024

Conversation

alexAubin
Copy link
Member

@alexAubin alexAubin commented Jan 2, 2024

cf YunoHost/issues#2050

Notes to test migration on a fresh VPS

curl https://install.yunohost.org | bash -s -- -a
# Drink coffee
yunohost tools postinstall -d bullseye-bookworm-migration.test -u camille -F Camille -p Yunohost
# Sip more coffee

# Install your favorite apps, for example:
# Nextcloud (PHP+mysql)
yunohost app install nextcloud --args "domain=bullseye-bookworm-migration.test&path=/cloud&admin=camille&init_main_permission=visitors&user_home=true&system_addressbook_exposed=yes"
# Wekan (Nodejs + mongodb) 
yunohost app install wekan --args "domain=bullseye-bookworm-migration.test&path=/wekan&admin=camille&init_main_permission=visitors"
# Terraforming mars (nodejs+postgresql) Actually requires a few GB of RAM to npm build ? :|
# yunohost app install terraforming-mars --args "domain=bullseye-bookworm-migration.test&path=/tfm&init_main_permission=visitors"
# Coin (Python + postgresql)
yunohost domain add coin.bullseye-bookworm-migration.test
yunohost app install coin --args "domain=coin.bullseye-bookworm-migration.test&admin=camille&[email protected]&isp_name=YunoHost&isp_site=yunohost.org"

# Gotta make sure we get to unstable, because only unstable packages of yunohost 12.x are available now
sed -i 's/stable/stable testing unstable/g' /etc/apt/sources.list.d/yunohost.list

# Dirty/manual apply of this PR
apt install aptitude -y
curl https://raw.githubusercontent.com/YunoHost/yunohost/migrate-to-bookworm/locales/en.json > /usr/share/yunohost/locales/en.json
curl https://raw.githubusercontent.com/YunoHost/yunohost/migrate-to-bookworm/src/utils/system.py > /usr/lib/python3/dist-packages/yunohost/utils/system.py
curl https://raw.githubusercontent.com/YunoHost/yunohost/migrate-to-bookworm/src/migrations/0027_migrate_to_bookworm.py > /usr/lib/python3/dist-packages/yunohost/migrations/0027_migrate_to_bookworm.py

# Disable check that system is up to date before migration
sed -i 's/raise.*not_fully_up_to_date.*/pass/g' /usr/lib/python3/dist-packages/yunohost/migrations/0027_migrate_to_bookworm.py

# Validate the migration is there
yunohost tools migrations list --pending

# Run the migration from the command line (OR restart yunohost-api and run the migration from the webadmin?)
yunohost tools migrations run --accept-disclaimer --debug

# Here be dragons

@alexAubin alexAubin added the 🏗️ Major project Big decision label Jan 2, 2024
@alexAubin alexAubin marked this pull request as draft January 2, 2024 20:01
@alexAubin alexAubin force-pushed the migrate-to-bookworm branch 4 times, most recently from c07aefa to 4bdf982 Compare January 2, 2024 23:05
@alexAubin
Copy link
Member Author

So it's working~ish on a clean install, next step is to check upgrading with a bunch of apps installed, trying to trigger tricky cases, polishing

os.system(f'wget --timeout 900 --quiet "{new_apt_key}" --output-document=- | gpg --dearmor >"/usr/share/keyrings/yunohost-bookworm.gpg"')

# Add Sury key even if extra_php_version.list was already there,
# because some old system may be using an outdated key not valid for Bookworm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reading the comments without understanding what an old system and an outdated key mean, but I feel that's not really linked to the migration and YNH should handle this key somewhere else.
I mean, we didn't change how sury is integrated to YNH in bookworm compared to bullseye?

# Critical fix for RPI otherwise network is down after rebooting
# https://forum.yunohost.org/t/20652
#
# FIXME : this is from buster->bullseye, do we still needed it ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder, we should check if the problem is still here

# Stupid hack for stupid dnsmasq not picking up its new init.d script then breaking everything ...
# https://forum.yunohost.org/t/20676
#
# FIXME : this is from buster->bullseye, do we still needed it ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be checked during the testing phase

Comment on lines 214 to 231
#cmd = "LC_ALL=C"
#cmd += " DEBIAN_FRONTEND=noninteractive"
#cmd += " APT_LISTCHANGES_FRONTEND=none"
#cmd += " apt dist-upgrade "
#cmd += " --quiet -o=Dpkg::Use-Pty=0 --fix-broken --dry-run"
#cmd += " | grep -q 'ynh-deps'"

#logger.info("Simulating upgrade...")
#if os.system(cmd) == 0:
# raise YunohostError(
# "The upgrade cannot be completed, because some app dependencies would need to be removed?",
# raw_msg=True,
# )

# FIXME :
#postupgradecmds = "rm -f /usr/sbin/policy-rc.d\n"
#postupgradecmds += "echo 'Restarting nginx...' >&2\n"
#postupgradecmds += "systemctl restart nginx\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wut, can we remove that?

conflicts = check_output("dpkg-query -s yunohost | grep '^Conflicts:'").strip()
if conflicts:
# We want to keep conflicting with apache/bind9 tho
new_conflicts = "Conflicts: apache2, bind9"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other conflicts ? In yunohost, admin, ssowat etc?

@alexAubin alexAubin force-pushed the migrate-to-bookworm branch from 4bdf982 to 383fd6f Compare April 10, 2024 19:14
@tituspijean
Copy link
Contributor

I have just upgraded a server from YunoHost 11.2.11.3 to 12 after following the instructions of the first message.

Migration runs smoothly, but the logging has a bug:

...
690523 SUCCESS Migration 0027_migrate_to_bookworm completed
690547 DEBUG action [68666.1] executed in 690.171s
690548 DEBUG lock has been released
Traceback (most recent call last):
  File "/usr/bin/yunohost", line 77, in <module>
    yunohost.cli(
  File "/usr/lib/python3/dist-packages/yunohost/__init__.py", line 41, in cli
    ret = moulinette.cli(
  File "/usr/lib/python3/dist-packages/moulinette/__init__.py", line 110, in cli
    load_only_category = args[0] if args and not args[0].startswith("-") else None
  File "/usr/lib/python3/dist-packages/moulinette/interfaces/cli.py", line 503, in run
    raise MoulinetteError("operation_interrupted")
  File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 580, in process
    - top_parser -- A BaseActionsMapParser-derived instance to use for
  File "/usr/lib/python3/dist-packages/yunohost/tools.py", line 825, in tools_migrations_run
    return sorted(migrations, key=lambda m: m.id)
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 671, in success
    """
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 709, in close
    msg = m18n.n("log_link_to_log", name=self.name, desc=desc)
  File "/usr/lib/python3/dist-packages/yunohost/log.py", line 797, in _get_description_from_name
    args = parts[1:]
ModuleNotFoundError: No module named '_strptime'

@centralscrutinizer21
Copy link

ok since I broke my matrix server for the n time I am going to be bad with my server and try this upgrade with several apps installed:

  • calibreweb
  • bludit
  • bookwyrm
  • castopod
  • cinny
  • collabora
  • coturn
  • element-call
  • invidious
  • libreddit
  • mautrix_signal
  • mautrix_telegram
  • mautrix_whatsapp
  • miniflux
  • nextcloud
  • yourls
  • pleroma
  • peertube
  • my_webapp
  • pixelfed
  • rss-bridge
  • navidrome
  • umami
  • vaultwarden
  • wallabag2
  • webtrees
  • wireguard
  • searxng
  • ntfy

It's a sacrifice for the greater good.
I have backups for the most important apps and media files in separate storages
I'll report the results

@Salamandar
Copy link
Contributor

Salamandar commented Jun 26, 2024

I have just upgraded a server from YunoHost 11.2.11.3 to 12 after following the instructions of the first message.

Migration runs smoothly, but the logging has a bug:

Same, and nginx is left dead

Jun 26 17:45:22 intra.syslinbit.com systemd[1]: Reload failed for nginx.service - A high performance web server and a reverse proxy server.

Restarting the nginx service works.

Roundcube seems broken though.

Capture d’écran du 2024-06-26 19-58-06

EDIT : Ah I had roundcube and snappymail installed before the migration, and snappymail is still working :)

@Salamandar
Copy link
Contributor

Webadmin issue : Clicking on this button changes the URL visible in the browser but doesn't actually redirect to the page…
Capture d’écran du 2024-07-04 19-41-32

@Salamandar Salamandar force-pushed the migrate-to-bookworm branch from b8c25db to f344cb0 Compare July 4, 2024 19:02
Salamandar and others added 5 commits July 4, 2024 21:26
…'s causing too many issues in dependency resolution idk
…, can't use raw bash redirects, gotta use stdin= from subprocess ... and we want only a limited number of 'yes' and not an infinite yes like the -y option does resuling in conflict resolution loops
@Salamandar
Copy link
Contributor

As is, this PR can be merged without risk.

@alexAubin
Copy link
Member Author

@alexAubin alexAubin marked this pull request as ready for review July 8, 2024 21:21
@alexAubin alexAubin merged commit a735a6d into dev Jul 8, 2024
2 of 3 checks passed
@alexAubin alexAubin deleted the migrate-to-bookworm branch July 8, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants