Project

General

Profile

Actions

Runbook » History » Revision 24

« Previous | Revision 24/26 (diff) | Next »
Carsten Rose, 09.06.2023 13:53


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.

Preparation on production

Switch to production server:

ssh lean.geo.uzh.ch

ssh lean-gate.geo.uzh.ch

Create dump files from databases:

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

Move page instance folder as backup from /var/www/html/ to /var/www/

mv /var/www/html/prod /var/www/html/prod.v9.old   
mv /var/www/html/preview /var/www/html/prod.v9.old

Do the same for other pages.

Preparation on dev

Switch to dev server:

webwork22r

Create dump of typo3 database:

mysqldump lean_dev_t3 > /var/tmp/lean_prod_t3_v11.sql
mysqldump lean_gate_t3 > /var/tmp/lean_gate_t3_v11.sql

Archive sql dump files:

cd /var/tmp
tar -czf lean_gate_db_t3_v11.tar.gz lean_prod_t3_v11.sql lean_gate_t3_v11.sql

Archive page instance:

cd /var/www/html
tar -czf /var/tmp/lean.tar.gz lean/ 
tar -czf /var/tmp/leangate.tar.gz leangate/

Archive new typo3 v11 (In this example the feLogin templates for geolean are included):

cd /var/www
tar -czf /var/tmp/typo3_v11.tar.gz typo3_src-11.5.25

File transfer: Dev to Production

Transfer archived page instance to production server:

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

Transfer typo3 v11 to production server:

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

Transfer typo3 database dump files to production server:

scp -r root@webwork22:/var/tmp/lean_gate_db_t3_v11.tar.gz root@lean.geo.uzh.ch:/var/tmp

Setup Production

Unpack page instance for prod and preview. Rename them to original name and check the right permissions:

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

Unpack typo3 v11 and check the right permissions:

tar -xzf typo3_v11.tar.gz -C /var/www/

Unpack typo3 database dump files and use them in production and preview:

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 

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

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)

Fullsync: New dev to new production

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

  1. First change the sync script for new instances.
  2. Execute full sync from dev > prev > production.

SQL Funtions

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.

Others

Sometimes T3 Cache could make problems while upgrading. Deleting the typo3temp folder helps.
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.

Updated by Carsten Rose about 1 year ago · 24 revisions