diff --git a/postgres/rootfs/etc/cont-init.d/20-folders.sh b/postgres/rootfs/etc/cont-init.d/20-folders.sh index 43286eb3b74..542dec596c1 100755 --- a/postgres/rootfs/etc/cont-init.d/20-folders.sh +++ b/postgres/rootfs/etc/cont-init.d/20-folders.sh @@ -2,3 +2,13 @@ # shellcheck shell=bash set -e +if [ -d /data/database ]; then + bashio::log.warning "Database migrated to /config" + mv /data/database /config +fi + +if [ -f /homeassistant/addons_config/postgres/config.yaml ]; then + bashio::log.warning "Config migrated to /config" + mv /homeassistant/addons_config/postgres/* /config/ + rm -r /homeassistant/addons_config/postgres +fi