Merge pull request #7747 from opf/fix/custom-pgloader-path

Allow custom pgloader path for packaged installations
pull/7749/head
Markus Kahl 5 years ago committed by GitHub
commit a633d93f20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      docker/mysql-to-postgres/bin/migrate-mysql-to-postgres
  2. 1
      docs/operations/migrating/manual/postgresql-migration.md
  3. 9
      docs/operations/migrating/packaged/postgresql-migration.md

@ -3,6 +3,7 @@ require 'uri'
db_url = URI(ENV.fetch("DATABASE_URL")) db_url = URI(ENV.fetch("DATABASE_URL"))
mysql_url = URI(ENV.fetch("MYSQL_DATABASE_URL")) if ENV.has_key?("MYSQL_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") if db_url.scheme.start_with?("mysql")
puts "WARNING: You are running MySQL. OpenProject will drop support for MySQL in 10.0." 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.query = nil
mysql_url.scheme = "mysql" 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 if pgloader_status != 0
puts "\nFailed to import MySQL database into Postgres. See above." puts "\nFailed to import MySQL database into Postgres. See above."

@ -129,7 +129,6 @@ compiled with SBCL 1.4.5.debian
``` ```
### Performing the migration ### Performing the migration
You are now ready to use `pgloader`. You simply point it the old and new database URL while specifying the option You are now ready to use `pgloader`. You simply point it the old and new database URL while specifying the option

@ -18,7 +18,14 @@ This guide should leave you with a set of archives that you can use to restore,
## Installation of pgloader ## 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 ### Ubuntu 18.04

Loading…
Cancel
Save