Skip to content
151 changes: 40 additions & 111 deletions guides/common/modules/proc_updating-disconnected-server-on-EL9.adoc
Original file line number Diff line number Diff line change
@@ -1,150 +1,79 @@
:_mod-docs-content-type: PROCEDURE

[id="Updating-Disconnected-{project-context}-on-EL9_{context}"]
= Updating a disconnected {ProjectServer} on {RHEL} 9
= Updating a disconnected {ProjectServer} on {EL} 9

You can update your disconnected {Project} on {RHEL} 9 by synchronizing the required repositories on the connected {Project} and syncing the content to the disconnected {Project} using `reposync`.
You can update your disconnected {Project} on {EL} 9 by synchronizing the required repositories on the connected {Project} and syncing the content to the disconnected {Project} by using `syncable` exports.

.Procedure on the connected {ProjectServer}
. Ensure that you have synchronized the following repositories in your connected {ProjectServer}:
. Synchronize the following repositories on your connected {ProjectServer}:
+
* {RepoRHEL9BaseOS}
* {RepoRHEL9AppStream}
* {RepoRHEL9ServerSatelliteServerProjectVersion}
* {RepoRHEL9ServerSatelliteMaintenanceProjectVersion}
. Download the debug certificate of the organization and store it locally at `/etc/pki/katello/certs/org-debug-cert.pem` or a location of your choosing.
For more information, see {AdministeringDocURL}Creating_an_Organization_Debug_Certificate_admin[Creating an Organization Debug Certificate] in _{AdministeringDocTitle}_.
. Create a Yum configuration file under `/etc/yum.repos.d`, such as `_{project-context}-disconnected_.repo`, with the following contents:
+
[options="nowrap" subs="+quotes,verbatim,attributes"]
----
[{RepoRHEL9BaseOS}]
name=Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)
baseurl=_https://{foreman-example-com}_/pulp/content/_My_Organization_/Library/content/dist/rhel9/9/x86_64/baseos/os
enabled = 1
sslclientcert = /etc/pki/katello/certs/org-debug-cert.pem
sslclientkey = /etc/pki/katello/certs/org-debug-cert.pem
sslcacert = /etc/pki/katello/certs/katello-server-ca.crt
sslverify = 1

[{RepoRHEL9AppStream}]
name=Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
baseurl=_https://{foreman-example-com}_/pulp/content/_My_Organization_/Library/content/dist/rhel9/9/x86_64/appstream/os
enabled = 1
sslclientcert = /etc/pki/katello/certs/org-debug-cert.pem
sslclientkey = /etc/pki/katello/certs/org-debug-cert.pem
sslcacert = /etc/pki/katello/certs/katello-server-ca.crt
sslverify = 1

[{RepoRHEL9ServerSatelliteServerProjectVersion}]
name={ProjectName} {ProjectVersion} for RHEL 9 RPMs x86_64
baseurl=_https://{foreman-example-com}_/pulp/content/_My_Organization_/Library/content/dist/layered/rhel9/x86_64/satellite/{ProjectVersion}/os
enabled = 1
sslclientcert = /etc/pki/katello/certs/org-debug-cert.pem
sslclientkey = /etc/pki/katello/certs/org-debug-cert.pem
sslcacert = /etc/pki/katello/certs/katello-server-ca.crt
sslverify = 1

[{RepoRHEL9ServerSatelliteMaintenanceProjectVersion}]
name={ProjectName} Maintenance {ProjectVersion} for RHEL 9 RPMs x86_64
baseurl=_https://{foreman-example-com}_/pulp/content/_My_Organization_/Library/content/dist/layered/rhel9/x86_64/sat-maintenance/{ProjectVersion}/os
enabled = 1
sslclientcert = /etc/pki/katello/certs/org-debug-cert.pem
sslclientkey = /etc/pki/katello/certs/org-debug-cert.pem
sslcacert = /etc/pki/katello/certs/katello-server-ca.crt
sslverify = 1
----
. In the configuration file, complete the following steps:
* For the `sslclientcert` and `sslclientkey` options, replace `/etc/pki/katello/certs/org-debug-cert.pem` with the location of the downloaded organization debug certificate.
* For the `baseurl` option, replace `{foreman-example-com}` with the correct FQDN of your connected {ProjectServer}.
* For the `baseurl` option, replace `My_Organization` with your organization label.
. Obtain the organization label:
+
----
$ hammer organization list
----
. Enter the `reposync` command:
. Export the repositories in the syncable format:
+
[options="nowrap" subs="+quotes,verbatim,attributes"]
----
# dnf reposync \
--delete \
--disableplugin=foreman-protector \
--download-metadata \
--repoid {RepoRHEL9AppStream} \
--repoid {RepoRHEL9BaseOS} \
--repoid {RepoRHEL9ServerSatelliteMaintenanceProjectVersion} \
--repoid {RepoRHEL9ServerSatelliteServerProjectVersion} \
-n \
-p ~/{Project}-repos
$ hammer content-export complete repository \
--id=_Repo_ID_ --format=syncable
----
+
This downloads the contents of the repositories from the connected {ProjectServer} and stores them in the directory `~/{Project}-repos`.
. Verify that the RPMs have been downloaded and the repository data directory is generated in each of the sub-directories of `~/{Project}-repos`.
. Archive the contents of the directory:
+
[options="nowrap" subs="+quotes,verbatim,attributes"]
----
# tar czf {Project}-repos.tgz -C ~ {Project}-repos
----
. Use the generated `{Project}-repos.tgz` file to update in the disconnected {ProjectServer}.
. Copy the exported directories to the disconnected {ProjectServer}.

.Procedure on the disconnected {ProjectServer}
. Copy the generated `{Project}-repos.tgz` file to your disconnected {ProjectServer}.
. Extract the archive to anywhere accessible by the `root` user.
In the following example `/root` is the extraction location.
+
[options="nowrap" subs="+quotes,verbatim,attributes"]
----
# tar zxf {Project}-repos.tgz -C /root
----
. Create a Yum configuration file under `/etc/yum.repos.d` with the following repository information:
. Locate the copied exported directories.
. Create the `/etc/yum.repos.d/upgrade.repo` file and update the `baseurl` values to point to the local file system:
+
[options="nowrap" subs="+quotes,verbatim,attributes"]
----
[{RepoRHEL9BaseOS}]
name=Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)
baseurl=file:///root/{Project}-repos/{RepoRHEL9BaseOS}
enabled = 1

metadata_expire=-1
gpgcheck=0
cost=500
baseurl=file:///_BaseOS_Export_Location_/content/dist/rhel9/9/x86_64/baseos/os
[{RepoRHEL9AppStream}]
name=Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
baseurl=file:///root/{Project}-repos/{RepoRHEL9AppStream}
enabled = 1

[{RepoRHEL9ServerSatelliteServerProjectVersion}]
name={ProjectNameX} for RHEL 9 Server RPMs x86_64
baseurl=file:///root/{Project}-repos/{RepoRHEL9ServerSatelliteServerProjectVersion}
enabled = 1

[{RepoRHEL9ServerSatelliteMaintenanceProjectVersion}]
name={ProjectName} Maintenance 6 for RHEL 9 Server RPMs x86_64
baseurl=file:///root/{Project}-repos/{RepoRHEL9ServerSatelliteMaintenanceProjectVersion}
enabled = 1
mediaid=None
metadata_expire=-1
gpgcheck=0
cost=500
baseurl=file:///_AppStream_Export_Location_/content/dist/rhel9/9/x86_64/appstream/os
[{Project}]
name={Project}
mediaid=None
metadata_expire=-1
gpgcheck=0
cost=500
baseurl=file:///_{Project}_Export_Location_/content/dist/layered/rhel9/x86_64/{project-context}/{ProjectVersion}/os/
----
. Upgrade {foreman-maintain} to the next version:
+
[options="nowrap" subs="attributes"]
----
# {foreman-maintain} self-upgrade --maintenance-repo-label={Project}
----
. In the configuration file, replace the `/root/{Project}-repos` with the extracted location.
. Use the health check option to determine if the system is ready for update.
On first use of this command, `{foreman-maintain}` prompts you to enter the hammer admin user credentials and saves them in the `/etc/foreman-maintain/foreman-maintain-hammer.yml` file.
. Evaluate that the system is ready for update.
The first time you run this command, `{foreman-maintain}` prompts you to enter the hammer admin user credentials and saves them to `/etc/foreman-maintain/foreman-maintain-hammer.yml`.
+
[options="nowrap" subs="+quotes,verbatim,attributes"]
----
# {foreman-maintain} update check \
--whitelist="check-upstream-repository,repositories-validate"
# {foreman-maintain} update check --whitelist="repositories-validate,repositories-setup"
----
. Review the results and address any highlighted error conditions before performing the update.
. Due to the lengthy update time, use a utility such as `tmux` to suspend and reattach a communication session.
You can then check the update progress without staying connected to the command shell continuously.
. Review the results and resolve any errors before proceeding with the update.
. Due to the lengthy update time, use a utility such as `tmux` to suspend and resume the session as needed.
By using such utility, you can monitor progress without maintaining a continuous connection to the command shell.
+
If you lose connection to the command shell where the update command is running, you can see the logged messages in the `{installer-log-file}` file to check if the process completed successfully.
If the update process is interrupted, check the `{installer-log-file}` file to confirm whether the process completed successfully.
. Perform the update:
+
[options="nowrap" subs="+quotes,verbatim,attributes"]
----
# {foreman-maintain} update run \
--whitelist="check-upstream-repository,repositories-setup,repositories-validate"
# {foreman-maintain} update run --whitelist="repositories-validate,repositories-setup"
----

include::snip_steps-needs-reboot.adoc[]

.Additional resources
* To restore the backup of the {ProjectServer} or {SmartProxyServer}, see {AdministeringDocURL}Restoring_from_a_Full_Backup_admin[Restoring {ProjectServer} or {SmartProxyServer} from a Backup].
* {AdministeringDocURL}Restoring_from_a_Full_Backup_admin[Restoring {ProjectServer} or {SmartProxyServer} from a backup]