Skip to content

Migration operating mode

kumy edited this page Sep 30, 2017 · 13 revisions

Migration procedure

Install

Create directory tree

GEOKRETY-LEGACY-REC/
├── configs
└── vars
    ├── generated
    ├── logs
    ├── mapka
    ├── mapki
    ├── obrazki
    ├── obrazki-dowonu
    ├── obrazki-male
    ├── statpics
    └── templates

Checkout code into src

cd GEOKRETY-LEGACY-REC/
git clone [email protected]:geokrety/www.git src

Create files missing from the git tree

cd GEOKRETY-LEGACY-REC/src
touch templates/konfig-local.php
touch templates/konfig-mysql.php
touch obrazek.png

Configure

Edit files and adapt.

cd GEOKRETY-LEGACY-REC/src
touch templates/konfig-local.php
touch templates/konfig-mysql.php

Synchronize pictures (iter 1)

TODO #1 insert script name here

Permissions

All files inside ./vars must be writable by the webserver. In the current image, www-data has id 33. So set owner as 33 or make directories writable for everyone.

chown -R 33.33 GEOKRETY-LEGACY-REC/vars/*

Set old server in Maintenance mode

TODO

Synchronize database

# On oldsrv:
cd ~/zzz_kumy
mysqldump -ugeokrety -p geokrety --default-character-set=latin1 -r geokrety-latin1.dump

scp geokrety-latin1.dump tr1.sys.kumy.org:~/GEOKRETY-LEGACY-REC/

# On newsrv:
cd ~/GEOKRETY-LEGACY-REC/
sed -i '/SET NAMES latin1/d' geokrety-latin1.dump
docker cp geokrety-latin1.dump mariadb:/tmp/
docker exec -it  mariadb bash
mysql -ugeokrety-legacy-rec -p --default-character-set=utf8 geokrety-legacy-rec
mysql> SET names 'utf8'
mysql> SOURCE /tmp/geokrety-latin1.dump

Change DNS entry

Change dns to point to the new server

geokrety.org. 3600 IN CNAME tr1.sys.kumy.org.

Clone this wiki locally