Project

General

Profile

Migration » History » Version 1

Benjamin Baer, 06.11.2022 18:51

1 1 Benjamin Baer
h1. Update Typo3 v8 > v9 > v10
2
3
h2. Preparation Typo3 v8
4
5
* Update Extensions to avoid problems after update.
6
** The IG LDAP Extension is the most likely culprit, we recommend to update to version 3.6.0 (which is compatible for typo3 v8 - v10). (Warning: later versions had problem with our LDAP Server, do not install any newer version if not needed)
7
*** Open the ldap 3.6 extension config dialog and save it, this prevents error after typo3 update to 9
8
*** Check if login still works (if not, it is possible to create new local admin users via /typo3/install.php)
9
** Update QFQ
10
* To easily downgrade again:
11
** copy the entire `typo3conf` Folder and store it in a temporary folder.
12
** Backup the typo3 database
13
14
h2. upgrade to newest version of Typo3 v9
15
16
* download 9.5.26
17
* replace symlink typo3_src
18
<pre>
19
rm typo3_src
20
ln -s /var/www/typo3_src-9.5.26/ typo3_src
21
</pre>
22
23
* go to installtool: /typo3/install.php
24
* Run the upgrade wizard under menu "Upgrade"
25
** Whenever there is an option, choose the default (most of the time to not do it, like backward compability to typo3 7 etc.)
26
* Afterwards run the database analyzer and apply the changes
27
* Go to "Environment > Directory Status" and autofix problems (this should create .htaccess for page slugs)
28
* Flush Caches
29
* Try to login to the backend
30
* Update to the newest Version of uzh_cd: https://www.math.uzh.ch/repo/?dir=uzhcd/v9
31
** Please note changes that have to be made to the config:
32
*** Remove all default js and css references for qfq, they are included now
33
*** Rewrite cd.fullWidth.pidList = 5,10 to: 
34
    <pre>cd.fullWidth.pidList = 5 in tree.rootLineIds || 10 in tree.rootLineIds</pre>
35
* If not happened before, update QFQ: https://qfq.io/download/?dir=releases (at least v 22.10.1)
36
* Do not update ig_ldap past 3.6.0!
37
38
h2. Upgrade to Typo3 v10
39
40
* download Typo3 v10
41
<pre>
42
cd /var/www/
43
wget --content-disposition https://get.typo3.org/10.4.15
44
tar -xzf typo3_src-10.4.15.tar.gz
45
rm typo3_src-10.4.15.tar.gz
46
</pre>
47
48
* update reference index:
49
** “System” > “DB check” module and use the “Check and update global reference index” function.
50
*** https://docs.typo3.org/m/typo3/guide-installation/master/en-us/Upgrade/UpdateReferenceIndex/Index.html
51
52
* replace symlink
53
<pre>
54
rm typo3_src
55
ln -s /var/www/typo3_src-10.4.15/ typo3_src
56
</pre>
57
58
* upgrade wizzard
59
** go install tool: /typo3/install.php
60
** upgrade > run upgrade wizard
61
** execute all except the ones that install extensions
62
** Analyze Database Structure > apply all changes
63
** Dump TCA
64
65
66
* clear caches
67
** Maintanance > Flush Cache
68
69
* delete the other temporary files, which TYPO3 saves in typo3temp/ by doing:
70
** Install tool > Maintanance > Remove Temporary Assets
71
72
* Go to "Environment > Directory Status" and autofix problems (this should create/update .htaccess for page slugs)
73
74
* Create a SiteConfiguration: typo3 Backend > Sites > New Configuration 
75
** This is needed for slugs to work. Also you need to create a second language entry here, if you have a german/english site.
76
77
h2. Nginx
78
79
NGinx does not read .htaccess files, so you need to manually add the config to your nginx sites. Here is an include:
80
81
<pre>
82
# Compressing resource files will save bandwidth and so improve loading speed especially for users
83
# with slower internet connections. TYPO3 can compress the .js and .css files for you.
84
# *) Set $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel'] = 9 for the Backend
85
# *) Set $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] = 9 together with the TypoScript properties
86
#    config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files.
87
location ~ \.js\.gzip$ {
88
    add_header Content-Encoding gzip;
89
    gzip off;
90
    types { text/javascript gzip; }
91
}
92
location ~ \.css\.gzip$ {
93
    add_header Content-Encoding gzip;
94
    gzip off;
95
    types { text/css gzip; }
96
}
97
98
# TYPO3 - Rule for versioned static files, configured through:
99
# - $GLOBALS['TYPO3_CONF_VARS']['BE']['versionNumberInFilename']
100
# - $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename']
101
if (!-e $request_filename) {
102
    rewrite ^/(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ /$1.$3 last;
103
}
104
105
# TYPO3 - Block access to composer files
106
location ~* composer\.(?:json|lock) {
107
    deny all;
108
}
109
110
# TYPO3 - Block access to flexform files
111
location ~* flexform[^.]*\.xml {
112
    deny all;
113
}
114
115
# TYPO3 - Block access to language files
116
location ~* locallang[^.]*\.(?:xml|xlf)$ {
117
    deny all;
118
}
119
120
# TYPO3 - Block access to static typoscript files
121
location ~* ext_conf_template\.txt|ext_typoscript_constants\.txt|ext_typoscript_setup\.txt {
122
    deny all;
123
}
124
125
# TYPO3 - Block access to miscellaneous protected files
126
location ~* /.*\.(?:bak|co?nf|cfg|ya?ml|ts|typoscript|tsconfig|dist|fla|in[ci]|log|sh|sql|sqlite)$ {
127
    deny all;
128
}
129
130
# TYPO3 - Block access to recycler and temporary directories
131
location ~ _(?:recycler|temp)_/ {
132
    deny all;
133
}
134
135
# TYPO3 - Block access to configuration files stored in fileadmin
136
location ~ fileadmin/(?:templates)/.*\.(?:txt|ts|typoscript)$ {
137
    deny all;
138
}
139
140
# TYPO3 - Block access to libraries, source and temporary compiled data
141
location ~ ^(?:vendor|typo3_src|typo3temp/var) {
142
    deny all;
143
}
144
145
# TYPO3 - Block access to protected extension directories
146
location ~ (?:typo3conf/ext|typo3/sysext|typo3/ext)/[^/]+/(?:Configuration|Resources/Private|Tests?|Documentation|docs?)/ {
147
    deny all;
148
}
149
150
151
location / {
152
    try_files $uri $uri/ /index.php$is_args$args;
153
}
154
155
location ~ [^/]\.php(/|$) {
156
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
157
    if (!-f $document_root$fastcgi_script_name) {
158
        return 404;
159
    }
160
    fastcgi_buffer_size 32k;
161
    fastcgi_buffers 8 16k;
162
    fastcgi_connect_timeout 240s;
163
    fastcgi_read_timeout 240s;
164
    fastcgi_send_timeout 240s;
165
166
    # this is the PHP-FPM upstream - see also: https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/#connecting-nginx-to-php-fpm
167
    include snippets/fastcgi-php.conf;
168
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
169
170
}
171
</pre>
172
173
the fastcgi_pass needs to be edited, here it is for standard ubuntu 20.04 nginx server.
174
175
You can save this file to /etc/nginx/snippets/typo3.conf and include it in your site config via `include ../snippets/typo3.conf`