Content
You are here:
Migration OP9 mysql to OP9 postgres encoding and timezone issues
Added by sru sru over 4 years ago
This is openproject 9.0.4 mysql which i try to convert to postgresql using pgloader.
- After the conversion, the encoding of workpackage texts has a wrong encoding. I can fix that by altering all mysql tables to utf8 before running pgloader.
- I would like to hear which tables exactly need to be converted, though.
- However, the "created on", "upgraded on" fields mostly show an offset of -01:00h (as one would expect in the case of a wrong timezone setting which i can not see as that is an "inplace migration").
- There are cases where the offset of "created on" is -01:00 whereas the "upgraded on" of the same workbook is -02:00h.
The process is exactly as described below, any ideas ?
wget -qO- https://dl.packager.io/srv/opf/pgloader-ccl/key | apt-key add -
wget -O /etc/apt/sources.list.d/pgloader-ccl.list https://dl.packager.io/srv/opf/pgloader-ccl/master/installer/debian/9.repo
apt-get update
apt-get install pgloader-ccl
apt-get install postgresql postgresql-contrib libpq-dev
cd /etc/ssl/certs/
cp server.crt server_postgres.crt
chown postgres:postgres server_postgres.crt
cd ../private/
cp server.key server_postgres.key
chown postgres:postgres server_postgres.key
chmod 0600 /etc/ssl/private/server_postgres.key
# set the path for cert and key here:
vi /etc/postgresql/9.6/main/postgresql.conf
service postgresql stop
service postgresql start
tail /var/log/postgresql/postgresql-9.6-main.log
su - postgres
createuser -P -d openproject
createdb -O openproject openproject
exit
openproject config:set MYSQL_DATABASE_URL="$(openproject config:get DATABASE_URL)"
openproject config:get MYSQL_DATABASE_URL
openproject config:set DATABASE_URL="postgresql://openproject:averysecurepassword@localhost/openproject"
openproject run ./docker/mysql-to-postgres/bin/migrate-mysql-to-postgres
apt-get remove mysql-server
openproject config:unset MYSQL_DATABASE_URL
openproject reconfigure
service apache2 restart
Replies (1)
Hi sru,
thanks for your report. We do use the pgloader defaults to try to set the correect timezone. However it would be possible in your case to enforce the timezone you want to apply for the timezone values such as described here: https://github.com/dimitri/pgloader/issues/150. We have not observed an issue yet with these values since the default should be UTC+0 timezones stored/normalized by Rails.
Regarding the encoding, what issues are you seeing and what encoding was your MySQL database set to ?
Best
Oliver