mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-29 21:54:13 +01:00
0f4972ad92
Bump up photon version to 4.0 Bump up redis version to 7.0 Bump up postgresql version to 13.10 Signed-off-by: Yang Jiao <jiaoya@vmware.com>
47 lines
1.2 KiB
Bash
Executable File
47 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
PGBINOLD="/usr/local/pg96/bin/"
|
|
PGBINNEW="/usr/bin"
|
|
PGDATAOLD=""
|
|
PGDATANEW=""
|
|
|
|
while [[ "$#" -gt 0 ]]; do
|
|
case $1 in
|
|
-b|--old-datadir) PGDATAOLD="$2"; shift ;;
|
|
-B|--new-datadir) PGDATANEW="$2"; shift ;;
|
|
-d|--old-bindir) PGBINOLD="$2"; shift ;;
|
|
-D|--new-bindir) PGBINNEW="$2"; shift ;;
|
|
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
if [ "$PGDATAOLD" = "" ] || [ "$PGDATANEW" = "" ]; then
|
|
echo "required parameter is missing: $PGDATAOLD, $PGDATANEW"
|
|
exit 1
|
|
fi
|
|
|
|
export PGDATAOLD=$PGDATAOLD
|
|
export PGDATANEW=$PGDATANEW
|
|
export PGBINNEW=$PGBINNEW
|
|
export PGBINOLD=$PGBINOLD
|
|
|
|
echo 'start to upgrade.'
|
|
cd /tmp
|
|
${PGBINNEW}/pg_upgrade \
|
|
--old-datadir=$PGDATAOLD \
|
|
--new-datadir=$PGDATANEW \
|
|
--old-bindir=$PGBINOLD \
|
|
--new-bindir=$PGBINNEW \
|
|
--old-options '-c config_file=$PGDATAOLD/postgresql.conf' \
|
|
--new-options '-c config_file=$PGDATANEW/postgresql.conf'
|
|
|
|
if [ $? -ne 0 ]; then
|
|
echo 'fail to upgrade.'
|
|
cat /tmp/pg_upgrade_internal.log
|
|
exit 1
|
|
fi
|
|
|
|
cp $PGDATAOLD/pg_hba.conf $PGDATANEW/pg_hba.conf
|
|
echo 'success to upgrade.'
|