Project

General

Profile

Runbook » History » Version 19

Enis Nuredini, 06.06.2023 17:00

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