Project

General

Profile

Runbook » History » Version 23

Carsten Rose, 09.06.2023 13:53

1 23 Carsten Rose
<<TableOfContents>>
2
3 1 Enis Nuredini
h1. Migration to Production
4
5
This is a step by step instruction to migrate a new tested dev instance with upgraded typo3 cms to production. Used as example is the geolean tool.
6
7 2 Enis Nuredini
h2. Preparation on production
8 1 Enis Nuredini
9
Switch to production server:
10
<pre>
11
ssh lean.geo.uzh.ch
12
</pre>
13
<pre>
14
ssh lean-gate.geo.uzh.ch
15
</pre>
16
17 4 Enis Nuredini
Create dump files from databases:
18 1 Enis Nuredini
<pre>
19 9 Enis Nuredini
mysqldump lean_prod_db > /var/tmp/lean_prod_db_dump.sql
20
mysqldump lean_prod_t3 > /var/tmp/lean_prod_t3_dump.sql
21
mysqldump lean_gate_prod_t3 > /var/tmp/lean_gate_t3_dump.sql
22 1 Enis Nuredini
</pre>
23
24 5 Enis Nuredini
Move page instance folder as backup from /var/www/html/ to /var/www/
25 1 Enis Nuredini
<pre>
26 10 Enis Nuredini
mv /var/www/html/prod /var/www/html/prod.v9.old   
27
mv /var/www/html/preview /var/www/html/prod.v9.old
28 1 Enis Nuredini
</pre>
29
Do the same for other pages.
30
31 3 Enis Nuredini
h2. Preparation on dev
32 1 Enis Nuredini
33
Switch to dev server:
34
<pre>
35
webwork22r
36
</pre>
37
38
Create dump of typo3 database:
39
<pre>
40
mysqldump lean_dev_t3 > /var/tmp/lean_prod_t3_v11.sql
41
mysqldump lean_gate_t3 > /var/tmp/lean_gate_t3_v11.sql
42
</pre>
43
44
Archive sql dump files:
45
<pre>
46
cd /var/tmp
47
tar -czf lean_gate_db_t3_v11.tar.gz lean_prod_t3_v11.sql lean_gate_t3_v11.sql
48
</pre>
49
50
Archive page instance:
51
<pre>
52
cd /var/www/html
53
tar -czf /var/tmp/lean.tar.gz lean/ 
54
tar -czf /var/tmp/leangate.tar.gz leangate/
55
</pre> 
56
57
Archive new typo3 v11 (In this example the feLogin templates for geolean are included):
58
<pre>
59
cd /var/www
60
tar -czf /var/tmp/typo3_v11.tar.gz typo3_src-11.5.25
61
</pre>
62
63
h2. File transfer: Dev to Production
64
65
Transfer archived page instance to production server:
66
<pre>
67
scp -r root@webwork22:/var/tmp/lean.tar.gz root@lean.geo.uzh.ch:/var/tmp
68
scp -r root@webwork22:/var/tmp/leangate.tar.gz root@lean-gate.geo.uzh.ch:/var/tmp
69
</pre>
70
71
Transfer typo3 v11 to production server:
72
<pre>
73
scp -r root@webwork22:/var/tmp/typo3_v11.tar.gz root@lean.geo.uzh.ch:/var/tmp
74
scp -r root@webwork22:/var/tmp/typo3_v11.tar.gz root@lean-geo.uzh.ch:/var/tmp
75
</pre>
76
77
Transfer typo3 database dump files to production server:
78
<pre>
79
scp -r root@webwork22:/var/tmp/lean_gate_db_t3_v11.tar.gz root@lean.geo.uzh.ch:/var/tmp
80
</pre>
81
82
h2. Setup Production
83
84
Unpack page instance for prod and preview. Rename them to original name and check the right permissions:
85
<pre>
86
ssh lean.geo.uzh.ch
87
cd /var/tmp
88
tar -xzf lean.tar.gz -C /var/www/html/
89
mv lean prod
90
tar -xzf lean.tar.gz -C /var/www/html/
91
mv lean preview
92
</pre>
93
94
Unpack typo3 v11 and check the right permissions:
95
<pre>
96
tar -xzf typo3_v11.tar.gz -C /var/www/
97
</pre>
98
99
Unpack typo3 database dump files and use them in production and preview:
100
<pre>
101
tar -xzf lean_gate_db_t3_v11.tar.gz -C ./
102
103
mysql lean_prod_t3 < /var/tmp/lean_prod_t3_v11.sql
104
mysql lean_preview_t3 < /var/tmp/lean_prod_t3_v11.sql 
105
mysql lean_gate_prod_t3 < /var/tmp/lean_gate_t3_v11.sql 
106
</pre>
107
108
Do the same for all existing page instances. (lean-gate)
109
110
h2. Configuraiton: qfq.json and LocalConfiguration.php
111
112
Now we need to change the used credentials from dev to the original ones from production. Btw best practice would be to refresh the used passwords. This will improve the security.
113
Change the typo3 database credentials in LocalConfiguration.php for production and preview: 
114
* dbname
115
* password
116
* user
117
118
Change qfq.json database credentials for production and preview:
119
* DB_1_USER
120
* DB_1_PASSWORD
121
* DB_1_NAME
122
123
Change these QFQ Configurations:
124
* baseUrl
125
* wkhtmltopdf (for geolean would be: LD_LIBRARY_PATH=/opt/wkhtmltox/lib /opt/wkhtmltox/bin/wkhtmltopdf)
126
* remove redirect E-Mail
127
128
Do the same for all other instances. (lean-gate)
129
130 13 Enis Nuredini
h2. Fullsync: New dev to new production
131 12 Enis Nuredini
132 15 Enis Nuredini
There may be refactoring changes in Form and FormElements that are required for the new T3 version.
133 14 Enis Nuredini
134 12 Enis Nuredini
# First change the sync script for new instances.
135 19 Enis Nuredini
# Execute full sync from dev > prev > production.
136 16 Enis Nuredini
137 21 Enis Nuredini
h2. SQL Funtions
138
139 22 Enis Nuredini
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.
140 21 Enis Nuredini
141 17 Enis Nuredini
h2. Others
142 16 Enis Nuredini
143 20 Enis Nuredini
Sometimes T3 Cache could make problems while upgrading. Deleting the typo3temp folder helps.
144 11 Enis Nuredini
Hint:
145
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.
146
147 1 Enis Nuredini
Maybe its necessary to refresh ldap password? Would help to improve security.