Skip to content

Instantly share code, notes, and snippets.

@rfay
Created August 18, 2022 23:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfay/27b12e49ceb1ed1e3959c603401b7010 to your computer and use it in GitHub Desktop.
Save rfay/27b12e49ceb1ed1e3959c603401b7010 to your computer and use it in GitHub Desktop.
Convert a pre-v1.19.0 in-volume database marker to current usage
#!/bin/bash
# convert the marker on an old pre-ddev v1.19 database to current usage
# See issue at https://github.com/drud/ddev/issues/4129
# First argument should be the project name
# Second argument is the correct value you want, for example,
# mariadb_10.2 or mysql_8.0
# Example: bash convert-old-db.sh fe-kuerschnersmart mariadb_10.2
if [ $# != 2 ]; then
echo "Please run this with '$0 <projectname> dbtype_dbversion', for example '$0 myproject mariadb_10.3'" && exit 1
fi
set -x
project=$1
db_type=$2
docker run -it --rm -v ${project}-mariadb:/tmp/db busybox sh -c "echo $db_type > /tmp/db/db_mariadb_version.txt"
set +x
echo -n "your in-volume database type_version is now "
docker run -it --rm -v ${project}-mariadb:/tmp/db busybox sh -c 'cat /tmp/db/db_mariadb_version.txt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment