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

Update migrate-from-pre-8.sh (#8789)

Jonas Plum035f68438597
diff --git a/script/migration/migrate-from-pre-8.sh b/script/migration/migrate-from-pre-8.sh
index 3734e419eef..7c8e721fab8 100755
--- a/script/migration/migrate-from-pre-8.sh
+++ b/script/migration/migrate-from-pre-8.sh
@@ -178,6 +178,7 @@ echo "2.2) Migrating from MySQL to Postgres (and 8 to 10)"
docker run \
--rm \
+ -v $PWD:/data \
--name migrate8to10 \
-e MYSQL_DATABASE_URL="mysql2://$MYSQL_USER:$MYSQL_PWD@$DOCKER_HOST_IP:$MYSQL_PORT/$DATABASE" \
-e DATABASE_URL="postgresql://postgres:postgres@$DOCKER_HOST_IP:$POSTGRES_PORT/$DATABASE" \
@@ -228,7 +229,7 @@ else
fi
echo
-echo "2.4) Dumping migrated database to $DATABASE-migrated.sql"
+echo "2.4) Dumping migrated database to $DATABASE-migrated.dump"
# using the running docker image to dump the database to ensure we use the same
# postgres client version and also so that a postgres client is not necessary to run this script
@@ -237,7 +238,8 @@ docker exec -e PGPASSWORD=postgres -it migrate8to10 pg_dump \
-p $POSTGRES_PORT \
-U postgres \
-d $DATABASE \
- > $DATABASE-migrated.sql
+ -F custom \
+ -f /data/$DATABASE-migrated.dump
if [[ $? -gt 0 ]]; then
echo " Could not dump database"