Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Allow custom pgloader path for packaged installations

Oliver Günther2868c13c46c9
diff --git a/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres b/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres
index 1ef28e9d481..52d771942cb 100755
--- a/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres
+++ b/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres
@@ -3,6 +3,7 @@ require 'uri'
db_url = URI(ENV.fetch("DATABASE_URL"))
mysql_url = URI(ENV.fetch("MYSQL_DATABASE_URL")) if ENV.has_key?("MYSQL_DATABASE_URL")
+pgloader_path = ENV.fetch('PGLOADER_PATH', 'pgloader-ccl')
if db_url.scheme.start_with?("mysql")
puts "WARNING: You are running MySQL. OpenProject will drop support for MySQL in 10.0."
@@ -113,7 +114,7 @@ puts "Importing database ..."
mysql_url.query = nil
mysql_url.scheme = "mysql"
-_, pgloader_status = run "pgloader-ccl --with \"preserve index names\" --verbose #{mysql_url} #{db_url}", record_output: false
+_, pgloader_status = run "#{pgloader_path} --with \"preserve index names\" --verbose #{mysql_url} #{db_url}", record_output: false
if pgloader_status != 0
puts "\nFailed to import MySQL database into Postgres. See above."
diff --git a/docs/operations/migrating/manual/postgresql-migration.md b/docs/operations/migrating/manual/postgresql-migration.md
index f83ea013ed0..0f35ed84bd4 100644
--- a/docs/operations/migrating/manual/postgresql-migration.md
+++ b/docs/operations/migrating/manual/postgresql-migration.md
@@ -129,7 +129,6 @@ compiled with SBCL 1.4.5.debian
```
-
### Performing the migration
You are now ready to use `pgloader`. You simply point it the old and new database URL while specifying the option
diff --git a/docs/operations/migrating/packaged/postgresql-migration.md b/docs/operations/migrating/packaged/postgresql-migration.md
index 998fe680568..1ed5767b56c 100644
--- a/docs/operations/migrating/packaged/postgresql-migration.md
+++ b/docs/operations/migrating/packaged/postgresql-migration.md
@@ -18,7 +18,14 @@ This guide should leave you with a set of archives that you can use to restore,
## Installation of pgloader
-We ship a custom version of pgloader (named `pgloader-ccl`), which embeds some memory optimizations useful when you are migrating from a large MySQL database. This also allows us to provide a unified migration experience for all installation types. This package is available for all the currently supported distributions at https://packager.io/gh/opf/pgloader-ccl.
+We ship a custom version of pgloader (named `pgloader-ccl`), which embeds some memory optimizations useful when you are migrating from a large MySQL database.
+This also allows us to provide a unified migration experience for all installation types.
+This package is available for all the currently supported distributions at https://packager.io/gh/opf/pgloader-ccl.
+
+There are some reports that the contained pgloader-ccl might fail with an internal error. We are not yet quite sure what is causing this,
+but you can alternative compile or provide your own pgloader (see https://pgloader.io for more information).
+
+To do that, set the environment variable `PGLOADER_PATH` to the absolute path of your provided pgloader.
### Ubuntu 18.04