Skip to content

Commit a1ddecf

Browse files
committed
Fine tune manually
1 parent 8c6845a commit a1ddecf

3 files changed

Lines changed: 21 additions & 36 deletions

File tree

guides/common/modules/proc_determining-whether-your-project-server-uses-internal-or-external-databases.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
[role="_abstract"]
77
You can confirm whether your {ProjectServer} uses internal or external databases by checking PostgreSQL deployment on the server.
88

9-
ifdef::containerized[]
109
.Procedure
10+
ifdef::containerized[]
1111
. On {ProjectServer}, inspect the persisted database mode:
1212
+
1313
[options="nowrap" subs="+quotes,attributes"]
@@ -30,9 +30,7 @@ When {ProjectServer} uses external databases, the local `postgresql.service` uni
3030
This check reflects steady-state configuration.
3131
During a migration to external databases, `database_mode` in `/var/lib/foremanctl/parameters.yaml` may already show `external` while the local `postgresql.service` unit is still active until you remove the internal PostgreSQL deployment.
3232
endif::containerized[]
33-
3433
ifndef::containerized[]
35-
.Procedure
3634
* On {ProjectServer}, query the status of your databases:
3735
+
3836
[options="nowrap" subs="+quotes,attributes"]

guides/common/modules/proc_migrating-to-external-databases.adoc

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
[role="_abstract"]
77
Migrate internal PostgreSQL databases from {ProjectServer} to a dedicated external host when you need to reduce server load or manage the database independently.
88

9+
ifdef::containerized[]
10+
[NOTE]
11+
====
12+
{insights-iop} requires internal database mode.
13+
You cannot migrate to an external database while {insights-iop} is enabled on {ProjectServer}.
14+
====
15+
endif::containerized[]
16+
917
.Prerequisites
1018
* You have installed and configured a PostgreSQL server on an external server.
1119
* You have confirmed that {ProjectServer} currently uses internal databases.
@@ -15,22 +23,7 @@ ifdef::containerized[]
1523
The `{foremanctl} backup` command stops all {Project} services during the backup process.
1624
endif::containerized[]
1725

18-
ifdef::containerized[]
19-
[NOTE]
20-
====
21-
The Insights Operating Platform (IOP) feature requires internal database mode.
22-
You cannot migrate to an external database while IOP is enabled on {ProjectServer}.
23-
If IOP is enabled, disable it before you start the migration:
24-
+
25-
[options="nowrap", subs="+quotes,attributes"]
26-
----
27-
# {foremanctl} deploy --remove-feature iop
28-
----
29-
====
30-
endif::containerized[]
31-
3226
.Procedure
33-
3427
ifdef::containerized[]
3528
. On {ProjectServer}, create a directory for the backup:
3629
+
@@ -44,7 +37,7 @@ ifdef::containerized[]
4437
----
4538
# {foremanctl} backup /var/_My_Migration_Backup_Directory_ \
4639
ifndef::foreman-el,foreman-deb[]
47-
--skip-pulp-content \
40+
--skip-pulp-content
4841
endif::[]
4942
----
5043
+
@@ -55,27 +48,27 @@ The command creates a timestamped subdirectory, for example `/var/_My_Migration_
5548
====
5649
The backup fails if Foreman or Pulp tasks are running.
5750
Wait for active tasks to finish before you run the backup, or add the `--wait-for-tasks` flag to wait for running tasks to complete:
58-
+
51+
5952
[options="nowrap", subs="+quotes,attributes"]
6053
----
61-
# {foremanctl} backup /var/_My_Migration_Backup_Directory_ --wait-for-tasks \
54+
# {foremanctl} backup /var/_My_Migration_Backup_Directory_ \
55+
--wait-for-tasks \
6256
ifndef::foreman-el,foreman-deb[]
63-
--skip-pulp-content \
57+
--skip-pulp-content
6458
endif::[]
6559
----
6660
====
6761
. Verify the backup:
6862
+
6963
[options="nowrap", subs="+quotes,attributes"]
7064
----
71-
# ls -lh /var/_My_Migration_Backup_Directory_/foreman-backup-*/
65+
# ls -lh /var/_My_Migration_Backup_Directory_/foreman-backup-\*/
7266
# cat /var/_My_Migration_Backup_Directory_/foreman-backup-*/metadata.yml
73-
# ls -lh /var/_My_Migration_Backup_Directory_/foreman-backup-*/*.dump
67+
# ls -lh /var/_My_Migration_Backup_Directory_/foreman-backup-\*/*.dump
7468
----
7569
+
7670
Confirm that the timestamped backup directory contains `foreman.dump`, `candlepin.dump`, `pulp.dump`, and `metadata.yml` files.
7771
endif::containerized[]
78-
7972
ifndef::containerized[]
8073
. On {ProjectServer}, stop all {Project} services except for PostgreSQL:
8174
+
@@ -101,11 +94,8 @@ endif::[]
10194
/var/_My_Migration_Backup_Directory_
10295
----
10396
endif::containerized[]
104-
10597
. Transfer the data to the new external databases:
10698
+
107-
In the following commands, replace `_TIMESTAMP_` with the timestamp directory that the backup created.
108-
+
10999
[options="nowrap", subs="+quotes,attributes"]
110100
----
111101
ifdef::containerized[]
@@ -123,6 +113,10 @@ PGPASSWORD='_Pulpcore_Password_' pg_restore --host=_postgres.example.com_ --user
123113
endif::[]
124114
endif::containerized[]
125115
----
116+
ifdef::containerized[]
117+
+
118+
Replace `foreman-backup-_TIMESTAMP_` with the timestamp directory that the backup created.
119+
endif::containerized[]
126120

127121
ifdef::containerized[]
128122
. Use the `{foremanctl} deploy` command to update {Project} to point to the new external databases:
@@ -170,11 +164,10 @@ The internal PostgreSQL database runs as a Podman container managed by the `post
170164
+
171165
[NOTE]
172166
====
173-
When you switch to external databases, `{foremanctl} deploy` does not remove Podman quadlet unit files under `/etc/containers/systemd/` (for example, `postgresql.container` and `postgresql.image`) or Podman secrets (for example, `postgresql-admin-password`).
167+
When you switch to external databases, `{foremanctl} deploy` does not remove Podman quadlet unit files under `/etc/containers/systemd/`, such as `postgresql.container` and `postgresql.image`, or Podman secrets, such as `postgresql-admin-password`.
174168
Stopping the service and removing `/var/lib/pgsql/data` disables the internal database and frees the data volume.
175169
====
176170
endif::containerized[]
177-
178171
ifndef::containerized[]
179172
. Use the `{foreman-installer}` command to update {Project} to point to the new
180173
ifndef::foreman-deb,foreman-el[]

guides/doc-Administering_Project/master.adoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@ ifndef::containerized[]
2727
include::common/assembly_tuning-with-predefined-profiles.adoc[leveloffset=+1]
2828
endif::[]
2929

30-
ifdef::containerized[]
31-
include::common/assembly_migrating-from-internal-databases-to-external-databases.adoc[leveloffset=+1]
32-
endif::[]
33-
34-
ifndef::containerized[]
3530
include::common/assembly_migrating-from-internal-databases-to-external-databases.adoc[leveloffset=+1]
36-
endif::[]
3731

3832
ifndef::containerized[]
3933

0 commit comments

Comments
 (0)