Bug 1406782 - Cannot upgrade 5.6 with embedded database to 5.8 with managed db
Summary: Cannot upgrade 5.6 with embedded database to 5.8 with managed db
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Upgrades
Version: 580
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks: sat580-low
TreeView+ depends on / blocked
 
Reported: 2016-12-21 13:05 UTC by Ales Dujicek
Modified: 2017-06-21 12:15 UTC (History)
2 users (show)

Fixed In Version: rhn-upgrade-5.8.0.13
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-21 12:15:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ales Dujicek 2016-12-21 13:05:27 UTC
Description of problem:

upgrade Sat 5.6 with embedded database to 5.8 with managed database failed

# ./install.pl --upgrade --disconnected --external-postgresql
* Starting Red Hat Satellite installer.
* Performing pre-install checks.
* Pre-install checks complete.  Beginning installation.
* RHSM Registration.
** Registration: Disconnected mode. Not registering with RHSM.
* RHSM Subscriptions.
** Subscriptions: Disconnected mode. Not attaching subscriptions.
** Subscriptions: Disconnected mode. Not enabling repositories.
* Upgrade flag passed.  Stopping necessary services.
* Purging conflicting packages.
* Checking for uninstalled prerequisites.
** Checking if yum is available ...
There are some packages from Red Hat Enterprise Linux that are not part
of the @base group that Satellite will require to be installed on this
system. The installer will try resolve the dependencies automatically.
However, you may want to install these prerequisites manually.
Do you want the installer to resolve dependencies [y/N]? y
* Installing Satellite packages.
* Now running spacewalk-setup.
* Setting up SELinux..
** Database: Setting up database connection for PostgreSQL backend.
Hostname (leave empty for local)? remote-managed-database
Port [5432]? 
Database [rhnschema]? satschema
Username [rhnuser]? satuser
Password [******]? 
** Database: Populating database.
** Database: Skipping database population.
* Configuring tomcat.
* Setting up users and groups.
** GPG: Initializing GPG and importing key.
* Performing initial configuration.
* Activating Red Hat Satellite.
** Manifest not activated.
** Upgrade process requires the manifest to be activated after the schema is upgraded.
* Configuring apache SSL virtual host.
Should setup configure apache's default ssl server for you (saves original ssl.conf) [Y]? 
* Configuring jabberd.
* Creating SSL certificates.
** Skipping SSL certificate generation.
* Deploying configuration files.
* Update configuration in database.
DBD::Pg::st execute failed: ERROR:  relation "rhntemplatestring" does not exist
LINE 2:   FROM rhnTemplateString TS
               ^ at /usr/bin/spacewalk-setup line 939, <STDIN> line 6.
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Pg::db handle dbname=satschema;host=remote-managed-database;port=5432 at /usr/bin/spacewalk-setup line 939, <STDIN> line 6.


And database is empty..
# spacewalk-sql -i
\dpsql (8.4.20, server 9.5.4)
WARNING: psql version 8.4, server version 9.5.
         Some psql features might not work.
Type "help" for help.

satschema=# \d
No relations found.



Version-Release number of selected component (if applicable):
rhn-upgrade-5.8.0.6-1.el6sat.noarch
spacewalk-setup-2.5.1-13.el6sat.noarch

Comment 1 Tomáš Kašpárek 2016-12-21 14:13:51 UTC
This is not supported scenario for upgrades, however the documentation may look a little misleading so I'd consider this a documentation bug (there are really no steps how to move between embedded and managed/external db during upgrades).

Comment 4 Lukáš Hellebrandt 2017-05-24 12:02:55 UTC
Verified with rhn-upgrade-5.8.0.23-1.

The rhn-upgrade's file /etc/sysconfig/rhn/satellite-upgrade/doc/satellite-upgrade-postgresql.txt now contains

"""
If you are migrating your database from Oracle to managed or external PostgreSQL option, or if you already have external or managed PostgreSQL database add the following switch:
"""

instead of

"""
If you are migrating your database to managed or external PostgreSQL option, add the following switch:
"""


Note You need to log in before you can comment on or make changes to this bug.