Project

General

Profile

20230610 Forkred » History » Version 14

Carsten Rose, 09.06.2023 14:12

1 4 Carsten Rose
{{child_pages}}
2
3
{{toc}}
4
5 6 Carsten Rose
h1. Forkred: OS Update U18>U22, T3 V9>V11, PHP 7.2>8.1, MariaDB 10.1>10.6
6 1 Carsten Rose
7 13 Carsten Rose
* Files: `/var/tmp/dev`
8 7 Carsten Rose
9 1 Carsten Rose
h2. VMWare Konsole
10
11 2 Carsten Rose
* Check das CR sich einloggen kann: https://wikiit.math.uzh.ch/it/bestpractice/vmware-console
12 1 Carsten Rose
13 2 Carsten Rose
  * Wird der IE genommen, funktioniert der Aufruf der vsphere Seite nciht.
14
  * Edge hat mehrere Minuten gebraucht um zu starten.
15
  * Firefox konnte sich anmelden, dann hat CR aber abgebrochen weil mittlerweile Edge gestartet ist.
16
17
* Edge hat die Konsole gut dargestellt.
18
19 1 Carsten Rose
h2. Preparation on production
20
21
<pre>
22
# Check das der neueste Kernel aktiv ist, falls nicht reboot
23
$ uname -a
24
$ dpkg --list | grep linux
25
26
#
27
# Alle alten Kernel entfernen! Das ist wichtig damit der do-release-upgrade Process nicht unnoetig alte Kernel Module aktualisiert.
28
#
29
$ CURRENT=`uname -a | cut -f 3 -d ' '`
30
$ ALL=`dpkg --list | grep -e linux-modules -e linux-image | grep -v $CURRENT | awk '{ print $2 }'`
31
$ for II in $ALL; do apt purge -y $II; done
32
33 2 Carsten Rose
# Backup Dir anlegen:
34
[user@tlX] mkdir /scratch/tmp/30/forkred
35
# Latest T3 nach Production kopieren
36
[user@tlX] scp /scratch/software/typo3/typo3_src-11.5.25.tgz root@forkred.uzh.ch:/var/tmp/
37 1 Carsten Rose
38 2 Carsten Rose
# T3 schonmal auspacken
39
[root@forkred] cd /var/html; tar zxf typo3_src-11.5.25.tgz
40 1 Carsten Rose
41 2 Carsten Rose
# ** Am Tag vor der Migration **
42
# Backup anlegen. Zuerst auf TL: `mkdir /scratch/tmp/30/forkred`
43
# 
44 14 Carsten Rose
[root@forkred]
45 2 Carsten Rose
$ cd /
46
$ tar cjfv /tmp/forkred.tar.bz2 boot etc initrd.img lib snap  swap.img var bin home lib64 opt root sbin srv usr vmlinuz
47
$ scp /tmp/forkred.tar.bz2 crose@ssh.math.uzh.ch:/scratch/tmp/30/forkred/
48
$ rsync -av /var/www/html crose@ssh.math.uzh.ch:/scratch/tmp/30/forkred/
49 1 Carsten Rose
50 2 Carsten Rose
# 
51
# ** Am Tag der Migration **
52
#
53 1 Carsten Rose
54 2 Carsten Rose
# Apache anhalten
55
$ service apache2 stop
56 1 Carsten Rose
57 9 Carsten Rose
# DBs - einmal lokal ablegen und dann nochmal remote sichern
58 8 Carsten Rose
$ mkdir /var/tmp/prod
59
$ rm *.sql
60 2 Carsten Rose
$ ALL="forkred_preview_db forkred_preview_t3 forkred_prod_db forkred_prod_t3 mysql"
61 9 Carsten Rose
$ for II in $ALL; do mysqldump $II > $II.sql ; done
62 8 Carsten Rose
$ scp *.sql crose@ssh.math.uzh.ch:/scratch/tmp/30/forkred/
63 1 Carsten Rose
64 2 Carsten Rose
# Backup latest files:
65
$ rsync -av --delete /var/www/html/ crose@ssh.math.uzh.ch:/scratch/tmp/30/forkred/html/
66 1 Carsten Rose
67 2 Carsten Rose
# 
68
# OS Migration: 
69
# 
70 1 Carsten Rose
71 2 Carsten Rose
# Ubuntu 20
72
$ do-release-upgrade 
73 1 Carsten Rose
74 2 Carsten Rose
# Login forkred(u20) und Apache direkt wieder anhalten:
75
$ service apache2 stop
76 1 Carsten Rose
77 2 Carsten Rose
# Ubuntu 22
78
$ do-release-upgrade 
79 1 Carsten Rose
80 2 Carsten Rose
# Login forkred(u22) und Apache direkt wieder anhalten:
81
$ service apache2 stop
82 1 Carsten Rose
</pre>
83
84 2 Carsten Rose
h2. Preparation on dev (webwork22)
85 1 Carsten Rose
86
<pre>
87 2 Carsten Rose
# Create dump of typo3 database:
88
$ mysqldump forkred_dev_t3 > /var/tmp/forkred_dev_t3_v11.sql
89
90
# Filestruktur 
91
$ cd /var/www/html
92
$ tar zcf /var/tmp/forkred_dev_v11.tgz forkred
93 1 Carsten Rose
</pre>
94
95
h2. File transfer: Dev to Production
96
97 2 Carsten Rose
Jump host TL
98 1 Carsten Rose
<pre>
99 2 Carsten Rose
[crose@tlX]
100 12 Carsten Rose
$ scp root@webwork22:/var/tmp/forkred_dev_t3.sql /scratch/tmp/30/forkred/dev/
101 2 Carsten Rose
$ scp root@webwork22:/var/tmp/forkred_dev_v11.tgz /scratch/tmp/30/forkred/dev/
102 1 Carsten Rose
103 2 Carsten Rose
$ rsync -av  /scratch/tmp/30/forkred/dev root@forkred.math.uzh.ch:/var/tmp/
104 1 Carsten Rose
</pre>
105
106
h2. Setup Production
107
108
<pre>
109 2 Carsten Rose
[root@forkred]
110 1 Carsten Rose
111 2 Carsten Rose
$ cd /var/www/
112
$ mv html html.v9
113 1 Carsten Rose
114 2 Carsten Rose
# Unpack page instance for prod and preview. Rename them to original name and check the right permissions:
115 1 Carsten Rose
116 2 Carsten Rose
# Prod
117
$ cd /var/www/
118
$ tar -xzf /var/tmp/dev/forkred_dev_v11.tgz
119
$ mv forkred html
120 1 Carsten Rose
121 2 Carsten Rose
# Preview
122
$ tar -xzf /var/tmp/dev/forkred_dev_v11.tgz
123
$ mv forkred prod/preview
124 1 Carsten Rose
125 10 Carsten Rose
# Import T3 DBs (Prod & Peview same)
126 1 Carsten Rose
$ mysql forkred_prod_t3 < /var/tmp/dev/forkred_dev_t3_v11.sql
127
$ mysql forkred_preview_t3 < /var/tmp/dev/forkred_dev_t3_v11.sql
128 10 Carsten Rose
129
# Sync QFQ Data
130
[crose@tlX]
131
$ /scratch/share/system/sync/forkred/
132
$ forkredDevPreviewSync.sh -f
133
$ forkredDevProdSync.sh -f
134 2 Carsten Rose
</pre>
135 1 Carsten Rose
136 2 Carsten Rose
h2. Configuration: qfq.json and LocalConfiguration.php
137 1 Carsten Rose
138 3 Carsten Rose
* Prepare the final config files in `/var/tmp/dev/preview|production`
139
140 2 Carsten Rose
qfq.json:
141
142 1 Carsten Rose
* DB_1_USER
143
* DB_1_PASSWORD
144
* DB_1_NAME
145
146 3 Carsten Rose
LocalConfiguration.php:
147 2 Carsten Rose
148
* db
149
* user
150
* password
151 1 Carsten Rose
* baseUrl
152 2 Carsten Rose
* wkhtmltopdf 
153
* redirect E-Mail
154
* sitename
155 1 Carsten Rose
156 2 Carsten Rose
* Do not copy 'installtoolpw', instead set it again via interface - this creates 'argon' as latest hashing method.
157 1 Carsten Rose
158
h2. SQL Funtions
159
160
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.
161
162
h2. Others
163
164
Sometimes T3 Cache could make problems while upgrading. Deleting the typo3temp folder helps.
165 2 Carsten Rose
166 1 Carsten Rose
Hint:
167
168 2 Carsten Rose
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.