Project

General

Profile

Runbook » History » Revision 14

Revision 13 (Enis Nuredini, 06.06.2023 16:58) → Revision 14/26 (Enis Nuredini, 06.06.2023 16:58)

h1. Migration to Production 

 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. 

 h2. Preparation on production 

 Switch to production server: 
 <pre> 
 ssh lean.geo.uzh.ch 
 </pre> 
 <pre> 
 ssh lean-gate.geo.uzh.ch 
 </pre> 

 Create dump files from databases: 
 <pre> 
 mysqldump lean_prod_db > /var/tmp/lean_prod_db_dump.sql 
 mysqldump lean_prod_t3 > /var/tmp/lean_prod_t3_dump.sql 
 mysqldump lean_gate_prod_t3 > /var/tmp/lean_gate_t3_dump.sql 
 </pre> 

 Move page instance folder as backup from /var/www/html/ to /var/www/ 
 <pre> 
 mv /var/www/html/prod /var/www/html/prod.v9.old    
 mv /var/www/html/preview /var/www/html/prod.v9.old 
 </pre> 
 Do the same for other pages. 

 h2. Preparation on dev 

 Switch to dev server: 
 <pre> 
 webwork22r 
 </pre> 

 Create dump of typo3 database: 
 <pre> 
 mysqldump lean_dev_t3 > /var/tmp/lean_prod_t3_v11.sql 
 mysqldump lean_gate_t3 > /var/tmp/lean_gate_t3_v11.sql 
 </pre> 

 Archive sql dump files: 
 <pre> 
 cd /var/tmp 
 tar -czf lean_gate_db_t3_v11.tar.gz lean_prod_t3_v11.sql lean_gate_t3_v11.sql 
 </pre> 

 Archive page instance: 
 <pre> 
 cd /var/www/html 
 tar -czf /var/tmp/lean.tar.gz lean/  
 tar -czf /var/tmp/leangate.tar.gz leangate/ 
 </pre>  

 Archive new typo3 v11 (In this example the feLogin templates for geolean are included): 
 <pre> 
 cd /var/www 
 tar -czf /var/tmp/typo3_v11.tar.gz typo3_src-11.5.25 
 </pre> 

 h2. File transfer: Dev to Production 

 Transfer archived page instance to production server: 
 <pre> 
 scp -r root@webwork22:/var/tmp/lean.tar.gz root@lean.geo.uzh.ch:/var/tmp 
 scp -r root@webwork22:/var/tmp/leangate.tar.gz root@lean-gate.geo.uzh.ch:/var/tmp 
 </pre> 

 Transfer typo3 v11 to production server: 
 <pre> 
 scp -r root@webwork22:/var/tmp/typo3_v11.tar.gz root@lean.geo.uzh.ch:/var/tmp 
 scp -r root@webwork22:/var/tmp/typo3_v11.tar.gz root@lean-geo.uzh.ch:/var/tmp 
 </pre> 

 Transfer typo3 database dump files to production server: 
 <pre> 
 scp -r root@webwork22:/var/tmp/lean_gate_db_t3_v11.tar.gz root@lean.geo.uzh.ch:/var/tmp 
 </pre> 

 h2. Setup Production 

 Unpack page instance for prod and preview. Rename them to original name and check the right permissions: 
 <pre> 
 ssh lean.geo.uzh.ch 
 cd /var/tmp 
 tar -xzf lean.tar.gz -C /var/www/html/ 
 mv lean prod 
 tar -xzf lean.tar.gz -C /var/www/html/ 
 mv lean preview 
 </pre> 

 Unpack typo3 v11 and check the right permissions: 
 <pre> 
 tar -xzf typo3_v11.tar.gz -C /var/www/ 
 </pre> 

 Unpack typo3 database dump files and use them in production and preview: 
 <pre> 
 tar -xzf lean_gate_db_t3_v11.tar.gz -C ./ 

 mysql lean_prod_t3 < /var/tmp/lean_prod_t3_v11.sql 
 mysql lean_preview_t3 < /var/tmp/lean_prod_t3_v11.sql  
 mysql lean_gate_prod_t3 < /var/tmp/lean_gate_t3_v11.sql  
 </pre> 

 Do the same for all existing page instances. (lean-gate) 

 h2. Configuraiton: qfq.json and LocalConfiguration.php 

 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. 
 Change the typo3 database credentials in LocalConfiguration.php for production and preview:  
 * dbname 
 * password 
 * user 

 Change qfq.json database credentials for production and preview: 
 * DB_1_USER 
 * DB_1_PASSWORD 
 * DB_1_NAME 

 Change these QFQ Configurations: 
 * baseUrl 
 * wkhtmltopdf (for geolean would be: LD_LIBRARY_PATH=/opt/wkhtmltox/lib /opt/wkhtmltox/bin/wkhtmltopdf) 
 * remove redirect E-Mail 

 Do the same for all other instances. (lean-gate) 

 h2. Fullsync: New dev to new production 

 There may be refactoring changes in Form and FormElements that are required for the new T3 release. 

 
 # First change the sync script for new instances. 
 # Execute full sync from dev to production. Becaus there could be refactoring changes in Form and FormElements which are needed for new T3 version. 

 Hint: 
 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. 

 Maybe its necessary to refresh ldap password? Would help to improve security.