You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: product_docs/docs/pem/8.0.1/pem_upgrade/02_upgrading_backend_database.mdx
+53-55Lines changed: 53 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -12,57 +12,56 @@ The update process described in this section uses the `pg_upgrade` utility to mi
12
12
!!! Note
13
13
If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_upgrade`:
14
14
15
-
````
16
-
- The `abstime`, `reltime`, and `tinterval` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with `timestamptz` data type use below command:
17
-
18
-
```text
19
-
DO
20
-
$$
21
-
DECLARE
22
-
rec record;
23
-
cnt integer;
24
-
BEGIN
25
-
-- Check for the deprecated type in our user info probe
26
-
SELECT count(*) INTO cnt
27
-
FROM pem.probe_column
28
-
WHERE sql_data_type = ‘abstime’ AND internal_name = ‘valuntil’;
29
-
IF cnt = 0 THEN
30
-
RETURN;
31
-
END IF;
32
-
ALTER TABLE pemdata.user_info
33
-
ALTER COLUMN valuntil SET DATA TYPE timestamptz;
34
-
ALTER TABLE pemhistory.user_info
35
-
ALTER COLUMN valuntil SET DATA TYPE timestamptz;
36
-
-- Now update the pem.probe_column itself
37
-
UPDATE pem.probe_column
38
-
SET sql_data_type = ‘timestamptz’
39
-
WHERE sql_data_type = ‘abstime’ AND internal_name = ‘valuntil’;
40
-
END;
41
-
$$ LANGUAGE ‘plpgsql’;
42
-
```
43
-
44
-
- Replace the below function to avoid any alert errors:
45
-
46
-
```text
47
-
CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size(
* During restoring the pem database, it does not maintain the order while
56
-
* inserting data in the table, and uses the sort table based on the
57
-
* names.
58
-
* Hence - we need to check the foreign key constraint is present before
59
-
* validating these values.
60
-
*/
61
-
IF EXISTS(
62
-
SELECT 1 FROM information_schema.table_constraints
63
-
WHERE constraint_name='alert_template_id_fkey' AND
64
-
table_name='alert' AND table_schema='pem'
65
-
) THEN
15
+
- The `abstime`, `reltime`, and `tinterval` datatypes are deprecated from Postgres version 12 or later, hence to replace those dataypes with `timestamptz` data type use below command:
16
+
17
+
```text
18
+
DO
19
+
$$
20
+
DECLARE
21
+
rec record;
22
+
cnt integer;
23
+
BEGIN
24
+
-- Check for the deprecated type in our user info probe
25
+
SELECT count(*) INTO cnt
26
+
FROM pem.probe_column
27
+
WHERE sql_data_type = ‘abstime’ AND internal_name = ‘valuntil’;
28
+
IF cnt = 0 THEN
29
+
RETURN;
30
+
END IF;
31
+
ALTER TABLE pemdata.user_info
32
+
ALTER COLUMN valuntil SET DATA TYPE timestamptz;
33
+
ALTER TABLE pemhistory.user_info
34
+
ALTER COLUMN valuntil SET DATA TYPE timestamptz;
35
+
-- Now update the pem.probe_column itself
36
+
UPDATE pem.probe_column
37
+
SET sql_data_type = ‘timestamptz’
38
+
WHERE sql_data_type = ‘abstime’ AND internal_name = ‘valuntil’;
39
+
END;
40
+
$$ LANGUAGE ‘plpgsql’;
41
+
```
42
+
43
+
- Replace the below function to avoid any alert errors:
44
+
45
+
```text
46
+
CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size(
* During restoring the pem database, it does not maintain the order while
55
+
* inserting data in the table, and uses the sort table based on the
56
+
* names.
57
+
* Hence - we need to check the foreign key constraint is present before
58
+
* validating these values.
59
+
*/
60
+
IF EXISTS(
61
+
SELECT 1 FROM information_schema.table_constraints
62
+
WHERE constraint_name='alert_template_id_fkey' AND
63
+
table_name='alert' AND table_schema='pem'
64
+
) THEN
66
65
/*
67
66
* Need to use the IS TRUE construct outside the main query, because
68
67
* otherwise if there's no template by that ID then the query would return
@@ -83,10 +82,9 @@ BEGIN
83
82
$SQL$ INTO res USING template_id, params;
84
83
END IF;
85
84
RETURN res;
86
-
END
87
-
$FUNC$ LANGUAGE 'plpgsql';
88
-
```
89
-
````
85
+
END
86
+
$FUNC$ LANGUAGE 'plpgsql';
87
+
```
90
88
91
89
`pg_upgrade` supports a transfer of data between servers of the same type. For example, you can use `pg_upgrade` to move data from a PostgreSQL 9.6 backend database to a PostgreSQL 11 backend database, but not to an Advanced Server 11 backend database. If you wish to migrate to a different type of backend database (i.e from a PostgreSQL server to Advanced Server), see [Moving the Postgres Enterprise Manager Server](03_moving_pem_server).
Copy file name to clipboardExpand all lines: product_docs/docs/pem/8.0.1/pem_upgrade/03_moving_pem_server.mdx
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -80,11 +80,11 @@ Before starting the server migration, you should ensure that the firewalls betwe
80
80
81
81
Note that invoking the `pg_dump` utility will not interrupt current database users.
82
82
83
-
!!! Note
84
-
If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_dump` to take backup:
83
+
!!! Note
84
+
If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_dump` to take backup:
85
85
86
-
````
87
-
- The ``abstime``, ``reltime``, and ``tinterval`` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with ``timestamptz`` data type use below command:
86
+
87
+
- The ``abstime``, ``reltime``, and ``tinterval`` datatypes are deprecated from Postgres version 12 or later, hence to replace those dataypes with ``timestamptz`` data type use below command:
88
88
89
89
```text
90
90
DO
@@ -112,7 +112,7 @@ Before starting the server migration, you should ensure that the firewalls betwe
112
112
$$ LANGUAGE ‘plpgsql’;
113
113
```
114
114
115
-
- Replace the below function to avoid any alert errors:
115
+
- Replace the below function to avoid any alert errors:
116
116
117
117
```text
118
118
CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size(
@@ -157,7 +157,6 @@ Before starting the server migration, you should ensure that the firewalls betwe
Copy file name to clipboardExpand all lines: product_docs/docs/pem/8.0/pem_upgrade/02_upgrading_backend_database.mdx
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,15 @@ legacyRedirectsGenerated:
8
8
9
9
If you are updating both PEM components and the PEM backend database, you should perform PEM component updates (the server and Agent) before updating the backend database. For more information about updating PEM component software, see [Upgrading a PEM Installation](01_upgrading_pem_installation/#upgrading_pem_installation).
10
10
11
-
!!! Note
12
-
From PEM 8.0 onwards, the PostgreSQL or EPAS version 11 or higher are only supported as backend database server. Hence if your backend database server is lower than version 11 then first you need to upgrade your backend database server and then upgrade the PEM components.
11
+
!!! Note
12
+
From PEM 8.0 onwards, the PostgreSQL or EPAS version 11 or higher are only supported as backend database server. Hence if your backend database server is lower than version 11 then first you need to upgrade your backend database server and then upgrade the PEM components.
13
13
14
14
The update process described in this section uses the `pg_upgrade` utility to migrate from one version of the backend server to a more recent version. `pg_upgrade` facilitates migration between any version of Postgres (version 9.5 or later), and any subsequent release of Postgres that is supported on the same platform.
15
15
16
16
!!! Note
17
-
If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_upgrade`:
17
+
If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run `pg_upgrade`:
18
18
19
-
- The `abstime`, `reltime`, and `tinterval` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with `timestamptz` data type use below command:
19
+
- The `abstime`, `reltime`, and `tinterval` datatypes are deprecated from Postgres version 12 or later, hence to replace those dataypes with `timestamptz` data type use following command:
20
20
21
21
```text
22
22
DO
@@ -44,7 +44,7 @@ If the source PEM Server is lower than the 7.16 version, then you need to replac
44
44
$$ LANGUAGE ‘plpgsql’;
45
45
```
46
46
47
-
- Replace the below function to avoid any alert errors:
47
+
- Replace the below function to avoid any alert errors:
48
48
49
49
```text
50
50
CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size(
Copy file name to clipboardExpand all lines: product_docs/docs/pem/8.0/pem_upgrade/03_moving_pem_server.mdx
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -84,10 +84,10 @@ Before starting the server migration, you should ensure that the firewalls betwe
84
84
85
85
Note that invoking the `pg_dump` utility will not interrupt current database users.
86
86
87
-
!!! Note
88
-
If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run ``pg_dump`` to take backup:
87
+
!!! Note
88
+
If the source PEM Server is lower than the 7.16 version, then you need to replace the following functions before you run ``pg_dump`` to take backup:
89
89
90
-
- The ``abstime``, ``reltime``, and ``tinterval`` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with ``timestamptz`` data type use below command:
90
+
- The ``abstime``, ``reltime``, and ``tinterval`` datatypes are depreacated from Postgres version 12 or later, hence to replace those dataypes with ``timestamptz`` data type use below command:
91
91
92
92
```text
93
93
DO
@@ -115,7 +115,7 @@ Before starting the server migration, you should ensure that the firewalls betwe
115
115
$$ LANGUAGE ‘plpgsql’;
116
116
```
117
117
118
-
- Replace the below function to avoid any alert errors:
118
+
- Replace the below function to avoid any alert errors:
119
119
120
120
```text
121
121
CREATE OR REPLACE FUNCTION pem.check_alert_params_array_size(
0 commit comments