Project

General

Profile

Migration » History » Version 2

Benjamin Baer, 06.11.2022 18:55

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 2 Benjamin Baer
* Open any page with a qfq record, you will get a warning message that you need to update {{pageAlias:T}} and {{pageId:T}} with an option to automatically do this > run the updater
78
** Afterwards click on check again and then choose "to never check for this again".
79
** Please note that all handwritten urls in qfq and form records have to be changed to slugs!
80
** Check if everything is working and make adjustment. Usually it just misses the slugs.
81
** For multilanguage setup, note that there is no longer an L=1 url parameter and you have to adjust records accordingly
82
83 1 Benjamin Baer
h2. Nginx
84
85
NGinx does not read .htaccess files, so you need to manually add the config to your nginx sites. Here is an include:
86
87
<pre>
88
# Compressing resource files will save bandwidth and so improve loading speed especially for users
89
# with slower internet connections. TYPO3 can compress the .js and .css files for you.
90
# *) Set $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel'] = 9 for the Backend
91
# *) Set $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] = 9 together with the TypoScript properties
92
#    config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files.
93
location ~ \.js\.gzip$ {
94
    add_header Content-Encoding gzip;
95
    gzip off;
96
    types { text/javascript gzip; }
97
}
98
location ~ \.css\.gzip$ {
99
    add_header Content-Encoding gzip;
100
    gzip off;
101
    types { text/css gzip; }
102
}
103
104
# TYPO3 - Rule for versioned static files, configured through:
105
# - $GLOBALS['TYPO3_CONF_VARS']['BE']['versionNumberInFilename']
106
# - $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename']
107
if (!-e $request_filename) {
108
    rewrite ^/(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ /$1.$3 last;
109
}
110
111
# TYPO3 - Block access to composer files
112
location ~* composer\.(?:json|lock) {
113
    deny all;
114
}
115
116
# TYPO3 - Block access to flexform files
117
location ~* flexform[^.]*\.xml {
118
    deny all;
119
}
120
121
# TYPO3 - Block access to language files
122
location ~* locallang[^.]*\.(?:xml|xlf)$ {
123
    deny all;
124
}
125
126
# TYPO3 - Block access to static typoscript files
127
location ~* ext_conf_template\.txt|ext_typoscript_constants\.txt|ext_typoscript_setup\.txt {
128
    deny all;
129
}
130
131
# TYPO3 - Block access to miscellaneous protected files
132
location ~* /.*\.(?:bak|co?nf|cfg|ya?ml|ts|typoscript|tsconfig|dist|fla|in[ci]|log|sh|sql|sqlite)$ {
133
    deny all;
134
}
135
136
# TYPO3 - Block access to recycler and temporary directories
137
location ~ _(?:recycler|temp)_/ {
138
    deny all;
139
}
140
141
# TYPO3 - Block access to configuration files stored in fileadmin
142
location ~ fileadmin/(?:templates)/.*\.(?:txt|ts|typoscript)$ {
143
    deny all;
144
}
145
146
# TYPO3 - Block access to libraries, source and temporary compiled data
147
location ~ ^(?:vendor|typo3_src|typo3temp/var) {
148
    deny all;
149
}
150
151
# TYPO3 - Block access to protected extension directories
152
location ~ (?:typo3conf/ext|typo3/sysext|typo3/ext)/[^/]+/(?:Configuration|Resources/Private|Tests?|Documentation|docs?)/ {
153
    deny all;
154
}
155
156
157
location / {
158
    try_files $uri $uri/ /index.php$is_args$args;
159
}
160
161
location ~ [^/]\.php(/|$) {
162
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
163
    if (!-f $document_root$fastcgi_script_name) {
164
        return 404;
165
    }
166
    fastcgi_buffer_size 32k;
167
    fastcgi_buffers 8 16k;
168
    fastcgi_connect_timeout 240s;
169
    fastcgi_read_timeout 240s;
170
    fastcgi_send_timeout 240s;
171
172
    # this is the PHP-FPM upstream - see also: https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/#connecting-nginx-to-php-fpm
173
    include snippets/fastcgi-php.conf;
174
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
175
176
}
177
</pre>
178
179
the fastcgi_pass needs to be edited, here it is for standard ubuntu 20.04 nginx server.
180
181
You can save this file to /etc/nginx/snippets/typo3.conf and include it in your site config via `include ../snippets/typo3.conf`