Project

General

Profile

20230610 Forkred » History » Version 8

Carsten Rose, 09.06.2023 14:01

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