diff --git a/baikal/rootfs/etc/cont-init.d/01-migrate.sh b/baikal/rootfs/etc/cont-init.d/01-migrate.sh new file mode 100644 index 000000000..140caf329 --- /dev/null +++ b/baikal/rootfs/etc/cont-init.d/01-migrate.sh @@ -0,0 +1,13 @@ +#!/usr/bin/with-contenv bashio +# shellcheck shell=bash +set -e + +#################### +# Migrate database # +#################### + +if [ -d /homeassistant/addons_config/baikal ]; then + echo "Moving database to new location /config, you won't be able to restore previous versions of the addon" + cp -rf /homeassistant/addons_config/baikal/* /config/ + rm -r /homeassistant/addons_config/baikal +fi