-
Notifications
You must be signed in to change notification settings - Fork 174
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
Server migrator to 15.4 #4704
Server migrator to 15.4 #4704
Changes from 5 commits
7250721
9e99bb3
e57bcfc
940ad8d
2261b47
cfcd8a4
70a0d71
9f8a5fd
09d35a3
62c2c41
770c1b5
9599b8d
b6b1d67
d17dbba
7f3ee0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,7 @@ Provides: spacewalk-db-virtual = %{version}-%{release} | |
Requires: spacewalk-backend-sql-postgresql | ||
Requires: spacewalk-java-postgresql | ||
Requires: perl(DBD::Pg) | ||
%if 0%{?suse_version} | ||
%if 0%{?suse_version} || 0%{?is_opensuse} | ||
%if 0%{?sle_version} >= 150400 | ||
Requires: postgresql14 | ||
Requires: postgresql14-contrib | ||
|
@@ -118,7 +118,7 @@ Requires: postgresql13-contrib | |
Conflicts: postgresql-implementation >= 14 | ||
Conflicts: postgresql-contrib-implementation >= 14 | ||
%endif # if sle_version >= 150400 | ||
%else # not suse_version | ||
%else # not suse_version or opensuse | ||
Requires: postgresql >= 12 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please put this and the line below to >= 14? |
||
Requires: postgresql-contrib >= 12 | ||
# we do not support postgresql versions > 13.x yet | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,27 +19,44 @@ echo | |
read -n 1 -s -r -p "Press any key to start the migration or CTRL+C to cancel..."; | ||
echo | ||
|
||
NEW_VERSION_ID=15.4 | ||
|
||
CHECK_OS=$(cat /etc/os-release | grep PRETTY_NAME) | ||
|
||
if [[ ${CHECK_OS} != *"openSUSE Leap"* ]]; then | ||
echo "Please check your OS. openSUSE Leap is needed " | ||
exit -1 | ||
fi | ||
|
||
spacewalk-service stop | ||
rm -rf /etc/zypp/repos.d.old | ||
mv /etc/zypp/repos.d /etc/zypp/repos.d.old | ||
mkdir /etc/zypp/repos.d | ||
zypper ar -n "Main Repository" http://download.opensuse.org/distribution/leap/15.3/repo/oss repo-oss | ||
zypper ar -n "Main Update Repository" http://download.opensuse.org/update/leap/15.3/oss repo-update | ||
zypper ar -n "Non-OSS Repository" http://download.opensuse.org/distribution/leap/15.3/repo/non-oss repo-non-oss | ||
zypper ar -n "Update Repository (Non-Oss)" http://download.opensuse.org/update/leap/15.3/non-oss/ repo-update-non-oss | ||
zypper ar -n "Main Repository" http://download.opensuse.org/distribution/leap/${NEW_VERSION_ID}/repo/oss repo-oss | ||
zypper ar -n "Main Update Repository" http://download.opensuse.org/update/leap/${NEW_VERSION_ID}/oss repo-update | ||
zypper ar -n "Non-OSS Repository" http://download.opensuse.org/distribution/leap/${NEW_VERSION_ID}/repo/non-oss repo-non-oss | ||
zypper ar -n "Update Repository (Non-Oss)" http://download.opensuse.org/update/leap/${NEW_VERSION_ID}/non-oss/ repo-update-non-oss | ||
zypper ar -n "Uyuni Server Stable" https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/images/repo/Uyuni-Server-POOL-x86_64-Media1/ uyuni-server-stable | ||
zypper ar -n "Update repository wiht updates from SUSE Linux Enterprise 15" http://download.opensuse.org/update/leap/15.3/sle repo-sle-update | ||
zypper ar -n "Update repository of openSUSE Backports" http://download.opensuse.org/update/leap/15.3/backports/ repo-backports-update | ||
zypper ar -n "Update repository wiht updates from SUSE Linux Enterprise" http://download.opensuse.org/update/leap/${NEW_VERSION_ID}/sle repo-sle-update | ||
zypper ar -n "Update repository of openSUSE Backports" http://download.opensuse.org/update/leap/${NEW_VERSION_ID}/backports/ repo-backports-update | ||
zypper ref | ||
zypper -n dup --allow-vendor-change | ||
if [ $? -ne 0 ];then | ||
echo "Migration went wrong. Please fix the issues and try again." | ||
ret=$? | ||
mbussolotto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if [[ $ret -ne 0 ]];then | ||
mbussolotto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "Migration went wrong. Please fix the issues and try again. return code is $ret" | ||
mbussolotto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
exit -1 | ||
fi | ||
|
||
mbussolotto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
CURRENT_VERSION_ID=$(cat /etc/os-release | grep VERSION_ID | cut -f2 -d=) | ||
|
||
if [[ "${CURRENT_VERSION_ID}" != "\"${NEW_VERSION_ID}\"" ]]; then | ||
echo "Migration went wrong. Expected version is ${NEW_VERSION_ID} instead is ${CURRENT_VERSION_ID}" | ||
echo "Please try to re-run this script" | ||
exit -1 | ||
fi | ||
|
||
echo | ||
echo "===================================================================" | ||
echo "If you did not yet migrate the database to postgresql13, do so now" | ||
echo "If you did not yet migrate the database to the new postgres version, do so now" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One minor thing about this: I don't think the user can do the DB migration before this script runs. Even if the new postgres is installed Shouldn't this sentece tell the user to run the DB migration script without any "if"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, also if new postgres version is installed, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be better now |
||
echo "by running /usr/lib/susemanager/bin/pg-migrate-x-to-y.sh" | ||
echo | ||
echo "Reboot system afterwards." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but I am wondering about this part... @sbluhm does it mean the installations on top of EL8 are still using PostgreSQL12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EL is using 13.5. Does the logic force a different version? (if it does, then it's not working :) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code forced to use a postgres version between 12 and 14, I just changed it from 13 to 15 (15 is not released yet).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. Thanks.
@sbluhm well, on paper EL should use the same version Uyuni uses for openSUSE.
Until now it was OK, because we were based on Leap 15.3 and PostgreSQL 13. But Uyuni 2022.06 will change to Leap 15.4 and PostgreSQL 14.
EL8 should be working, as I don't recall we are using anything specific that only works for PostgreSQL 14. But now that we have it on Uyuni for Leap, that could change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, it could be Uyuni on EL won't start again if it's not switched to PostgreSQL 14.
From the SUSE Manager 4.3 release notes I am copying this to Uyuni 2022.06:
Not sure if that check works for EL as well, but FMPOV, this should be reviewed and EL should use PosgreSQL 14 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, let me check what I can do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will have postgresql14