Skip to content

Commit

Permalink
server migrator to 15.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mbussolotto committed Apr 28, 2022
1 parent ba92aab commit 7250721
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
37 changes: 27 additions & 10 deletions susemanager/bin/server-migrator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$?
if [[ $ret -ne 0 ]];then
echo "Migration went wrong. Please fix the issues and try again. return code is $ret"
exit -1
fi

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"
echo "by running /usr/lib/susemanager/bin/pg-migrate-x-to-y.sh"
echo
echo "Reboot system afterwards."
Expand Down
2 changes: 2 additions & 0 deletions susemanager/susemanager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- Update server-migrator to dist-upgrade to openSUSE 15.4

-------------------------------------------------------------------
Tue Apr 19 12:11:26 CEST 2022 - jgonzalez@suse.com

Expand Down

0 comments on commit 7250721

Please sign in to comment.