Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Migration OP9 mysql to OP9 postgres encoding and timezone issues

Migration OP9 mysql to OP9 postgres encoding and timezone issues

Added by sru sru almost 5 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)

RE: Migration OP9 mysql to OP9 postgres encoding and timezone issues - Added by Oliver Günther almost 5 years ago

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

  • (1 - 1/1)
Loading...