Project

General

Profile

Runbook » History » Version 24

Carsten Rose, 09.06.2023 13:53

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