Project

General

Profile

20230610 Forkred » History » Version 3

Carsten Rose, 09.06.2023 13:49

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