Content
You are here:
[SOLVED][PostgreSQL] Error during migration
Added by stefano marty about 5 years ago
I'm trying to migrate from MySQL to PostgresSQL in order to upgrade OpenProject to v.10. OpenProject v.9 is running on Debian 8 and working good.
I follow all the steps explained here:
https://www.openproject.org/operations/migration-guides/migrating-packaged-openproject-database-postgresql/
Everything's fine until I run the migration tool, where I get this error:
openproject run ./docker/mysql-to-postgres/bin/migrate-mysql-to-postgres
Migrating database from MySQL to PostgreSQL.
Import
MySQL database
mysql://root:REDACTED@localhost:3306/openproject
into Postgres database
postgresql://openproject:REDACTED@localhost/openproject
?
WARNING: This resets the given Postgres database.
Y/n Y
Resetting target database...
Database dropped
Creating database...
Importing database ...
2019-09-29T23:32:53.000675Z NOTICE Starting pgloader, log system is ready.
2019-09-29T23:32:53.001404Z LOG pgloader version "3.6.1"
Unhandled exception 4 at 0x7f056f972980, context->regs at #x7f056f1f14c8
Exception occurred while executing foreign code
? for help
^CTraceback (most recent call last):
4: from /home/openproject/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres:116:in `<main>'
3: from /home/openproject/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres:70:in `run'
2: from /home/openproject/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres:70:in `spawn'
1: from /home/openproject/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres:72:in `block in run'
/home/openproject/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres:72:in `each': Interrupt
^C is needed to exit the tool, as it's stuck after the line showing "? for help".
I tried googling the "Unhandled exception" error but I found nothing related.
Any suggestion on how to fix this? Thanks.
Replies (3)
Hi Stefano,
this might be related to https://community.openproject.com/projects/openproject/work_packages/30987/activity which we could not yet reproduce in our tests.
You could try to install the pgloader from PostgreSQL's own apt source or manually from https://github.com/dimitri/pgloader/blob/master/INSTALL.md
And then replace the
pgloader-ccl
command in the migration script with the absolute path to your local pgloader. We will provide a way to override its path in a upcoming release.Best,
Oliver
Replacing pgloader-ccl with pgloader solved the issue, thanks.
When I replaced it, at first I still got an error from pgloader, but different from the pgloader-ccl one: it was about the MySQL password. The password contained some special char, like & and /, so I changed it with a new one, containing regular chars only. That solved the issue, and the migration completed with just a few warnings.
While the old MySQL password was ok with the OpenProject access to the MySQL DB, it looks like the migration tool is not converting the percent-encoded characters back to normal. It's just a feeling, but maybe it's worth checking.
Thanks for reporting your findings. Maybe pgloader doesn't need the percent encoding that Rails does, so we could unencode the MySQL URL in that case.
For providing a custom pgloader instance, I added an env variable override in https://github.com/opf/openproject/pull/7747
Best,
Oliver