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

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

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

# 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/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
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?

@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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
3 participants