Fix data migration ordering

This commit is contained in:
Alexandre
2026-01-28 19:59:55 +01:00
parent dca06b9a9d
commit f9cfbe402b

View File

@@ -18,7 +18,6 @@ LEGACY1="/config/birdnet-pipy/data"
LEGACY2="/data"
mkdir -p "${DATA_LOCATION}"
mkdir -p "${DATA_LOCATION}/config" "${DATA_LOCATION}/clips" "${DATA_LOCATION}/logs" "${DATA_LOCATION}/cache" || true
if [ -z "$(ls -A "${DATA_LOCATION}" 2>/dev/null || true)" ]; then
if [ -d "${LEGACY1}" ] && [ -n "$(ls -A "${LEGACY1}" 2>/dev/null || true)" ]; then
@@ -30,6 +29,8 @@ if [ -z "$(ls -A "${DATA_LOCATION}" 2>/dev/null || true)" ]; then
fi
fi
mkdir -p "${DATA_LOCATION}/config" "${DATA_LOCATION}/clips" "${DATA_LOCATION}/logs" "${DATA_LOCATION}/cache" || true
rm -rf /app/data
ln -s "${DATA_LOCATION}" /app/data