Project

General

Profile

20230610 Forkred » History » Version 5

Carsten Rose, 09.06.2023 13:55

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