diff --git a/docker-compose.migrate.yml b/docker-compose.migrate.yml new file mode 100644 index 000000000..326bccfc0 --- /dev/null +++ b/docker-compose.migrate.yml @@ -0,0 +1,11 @@ +version: '2.2' + +services: + web: + volumes: + - /var/azuracast/stations:/var/azuracast/stations + - /var/azuracast/backups:/var/azuracast/backups + + stations: + volumes: + - /var/azuracast/stations:/var/azuracast/stations diff --git a/docker-migrate.sh b/docker-migrate.sh index a124f033e..eb4575769 100644 --- a/docker-migrate.sh +++ b/docker-migrate.sh @@ -20,7 +20,7 @@ BASE_DIR=`pwd` # Create backup from existing installation. chmod a+x bin/azuracast -./bin/azuracast azuracast:backup --exclude-media ./migration.tar.gz +./bin/azuracast azuracast:backup --exclude-media migration.zip read -n 1 -s -r -p "Database backed up. Press any key to continue (Install Docker)..." @@ -41,24 +41,22 @@ chmod a+x uninstall.sh read -n 1 -s -r -p "Uninstall complete. Press any key to continue (Install AzuraCast in Docker)..." +# Copy override file. +cp docker-compose.migrate.yml docker-compose.override.yml + # Spin up Docker docker-compose pull sleep 5 -# Copy media. -docker-compose run --user="azuracast" --rm \ - -v /var/azuracast/stations:/tmp/migration \ - mv /tmp/migration/* /var/azuracast/stations - # Copy all other settings. chmod a+x docker.sh -./docker.sh restore ./migration.tar.gz +./docker.sh restore migration.zip read -n 1 -s -r -p "Docker is running. Press any key to continue (cleanup)..." # Codebase cleanup rm -rf /var/azuracast/stations -find -maxdepth 1 ! -name migration.tar.gz ! -name . ! -name docker-compose.yml \ +find -maxdepth 1 ! -name . ! -name docker-compose.yml ! -name docker-compose.override.yml \ ! -name docker.sh ! -name .env ! -name azuracast.env ! -name plugins \ -exec rm -rv {} \; diff --git a/docker.sh b/docker.sh index 9a3f31511..d8d162fd5 100755 --- a/docker.sh +++ b/docker.sh @@ -226,7 +226,6 @@ restore() { echo "File $BACKUP_PATH does not exist in this directory. Nothing to restore." exit 1 fi - echo 'test' } #