Project

General

Profile

20230610 Forkred » History » Version 1

Carsten Rose, 09.06.2023 11:05

1 1 Carsten Rose
h1. Forkred: OS Update U18 zu U22, T3 V9 zu V11, PHP 8.2
2
3
h2. VMWare Konsole
4
5
* Check das CR sich einloggen kann
6
* Check das ein Ubuntu 22.04 Image zur Verfuegung steht
7
8
h2. Preparation on production
9
10
<pre>
11
# Check das der neueste Kernel aktiv ist, falls nicht reboot
12
$ uname -a
13
$ dpkg --list | grep linux
14
15
#
16
# Alle alten Kernel entfernen! Das ist wichtig damit der do-release-upgrade Process nicht unnoetig alte Kernel Module aktualisiert.
17
#
18
$ CURRENT=`uname -a | cut -f 3 -d ' '`
19
$ ALL=`dpkg --list | grep -e linux-modules -e linux-image | grep -v $CURRENT | awk '{ print $2 }'`
20
$ for II in $ALL; do apt purge -y $II; done
21
</pre>
22
23
24
25
26
27
===================================
28
29
30
Create dump files from databases:
31
<pre>
32
mysqldump lean_prod_db > /var/tmp/lean_prod_db_dump.sql
33
mysqldump lean_prod_t3 > /var/tmp/lean_prod_t3_dump.sql
34
mysqldump lean_gate_prod_t3 > /var/tmp/lean_gate_t3_dump.sql
35
</pre>
36
37
Move page instance folder as backup from /var/www/html/ to /var/www/
38
<pre>
39
mv /var/www/html/prod /var/www/html/prod.v9.old   
40
mv /var/www/html/preview /var/www/html/prod.v9.old
41
</pre>
42
Do the same for other pages.
43
44
h2. Preparation on dev
45
46
Switch to dev server:
47
<pre>
48
webwork22r
49
</pre>
50
51
Create dump of typo3 database:
52
<pre>
53
mysqldump lean_dev_t3 > /var/tmp/lean_prod_t3_v11.sql
54
mysqldump lean_gate_t3 > /var/tmp/lean_gate_t3_v11.sql
55
</pre>
56
57
Archive sql dump files:
58
<pre>
59
cd /var/tmp
60
tar -czf lean_gate_db_t3_v11.tar.gz lean_prod_t3_v11.sql lean_gate_t3_v11.sql
61
</pre>
62
63
Archive page instance:
64
<pre>
65
cd /var/www/html
66
tar -czf /var/tmp/lean.tar.gz lean/ 
67
tar -czf /var/tmp/leangate.tar.gz leangate/
68
</pre> 
69
70
Archive new typo3 v11 (In this example the feLogin templates for geolean are included):
71
<pre>
72
cd /var/www
73
tar -czf /var/tmp/typo3_v11.tar.gz typo3_src-11.5.25
74
</pre>
75
76
h2. File transfer: Dev to Production
77
78
Transfer archived page instance to production server:
79
<pre>
80
scp -r root@webwork22:/var/tmp/lean.tar.gz root@lean.geo.uzh.ch:/var/tmp
81
scp -r root@webwork22:/var/tmp/leangate.tar.gz root@lean-gate.geo.uzh.ch:/var/tmp
82
</pre>
83
84
Transfer typo3 v11 to production server:
85
<pre>
86
scp -r root@webwork22:/var/tmp/typo3_v11.tar.gz root@lean.geo.uzh.ch:/var/tmp
87
scp -r root@webwork22:/var/tmp/typo3_v11.tar.gz root@lean-geo.uzh.ch:/var/tmp
88
</pre>
89
90
Transfer typo3 database dump files to production server:
91
<pre>
92
scp -r root@webwork22:/var/tmp/lean_gate_db_t3_v11.tar.gz root@lean.geo.uzh.ch:/var/tmp
93
</pre>
94
95
h2. Setup Production
96
97
Unpack page instance for prod and preview. Rename them to original name and check the right permissions:
98
<pre>
99
ssh lean.geo.uzh.ch
100
cd /var/tmp
101
tar -xzf lean.tar.gz -C /var/www/html/
102
mv lean prod
103
tar -xzf lean.tar.gz -C /var/www/html/
104
mv lean preview
105
</pre>
106
107
Unpack typo3 v11 and check the right permissions:
108
<pre>
109
tar -xzf typo3_v11.tar.gz -C /var/www/
110
</pre>
111
112
Unpack typo3 database dump files and use them in production and preview:
113
<pre>
114
tar -xzf lean_gate_db_t3_v11.tar.gz -C ./
115
116
mysql lean_prod_t3 < /var/tmp/lean_prod_t3_v11.sql
117
mysql lean_preview_t3 < /var/tmp/lean_prod_t3_v11.sql 
118
mysql lean_gate_prod_t3 < /var/tmp/lean_gate_t3_v11.sql 
119
</pre>
120
121
Do the same for all existing page instances. (lean-gate)
122
123
h2. Configuraiton: qfq.json and LocalConfiguration.php
124
125
Now we need to change the used credentials from dev to the original ones from production. Btw best practice would be to refresh the used passwords. This will improve the security.
126
Change the typo3 database credentials in LocalConfiguration.php for production and preview: 
127
* dbname
128
* password
129
* user
130
131
Change qfq.json database credentials for production and preview:
132
* DB_1_USER
133
* DB_1_PASSWORD
134
* DB_1_NAME
135
136
Change these QFQ Configurations:
137
* baseUrl
138
* wkhtmltopdf (for geolean would be: LD_LIBRARY_PATH=/opt/wkhtmltox/lib /opt/wkhtmltox/bin/wkhtmltopdf)
139
* remove redirect E-Mail
140
141
Do the same for all other instances. (lean-gate)
142
143
h2. Fullsync: New dev to new production
144
145
There may be refactoring changes in Form and FormElements that are required for the new T3 version.
146
147
# First change the sync script for new instances.
148
# Execute full sync from dev > prev > production.
149
150
h2. SQL Funtions
151
152
The use of dump files doesn't include sql functions. Exporting them with phpMyAdmin from source to target is currently the best solution. In most cases not necessary because upgrade happens on an existing instance with given databases.
153
154
h2. Others
155
156
Sometimes T3 Cache could make problems while upgrading. Deleting the typo3temp folder helps.
157
Hint:
158
Using relative paths in typo3 template editor could make problems in v11. It helps to change them to aboslute paths. Good example for these situations are the use of 'cd.stylesheet =' options.
159
160
Maybe its necessary to refresh ldap password? Would help to improve security.