This Docker image allows you to automate a full backup of your Spotify Library every day using Spotishell PS module.
This full backup can be used to be restored over your account or another one.
You first need to create a Spotify Application.
Step1: Go to the Spotify for Developers Dashboard and create an app:
- App name :
spotifybackup
- App description :
spotifybackup
- Redirect URI :
http://localhost:8080/spotishell
Step2: Collect Client ID and Secret
To setup Spotify connection, you need to run the image in "setup mode" using this commandline and follow instruction:
docker run -it --rm -v spotifybackup:/data --entrypoint pwsh domochip/spotifybackup setup.ps1
Provide Client ID and Client Secret then copy authorization URL:
Paste authorization URL in your browser, read then accept:
Copy the redirected url from the address bar:
Paste it into the setup container window (you should then receive a green result):
Resulting connection information are then stored into the spotifybackup
docker volume
Docker Quick-Run
docker run \
-d \
--name spotifybackup \
-e BACKUPHOUR=2 \
-e BACKUPRETENTION=30 \
-e BACKUPPREFIX=SpotifyBackup \
-v spotifybackup:/data \
domochip/spotifybackup
Docker-Compose Quick-Run
version: '3'
volumes:
spotifybackup:
services:
spotifybackup:
container_name: spotifybackup
image: domochip/spotifybackup
volumes:
- spotifybackup:/data
environment:
- BACKUPHOUR=2
- BACKUPRETENTION=30
- BACKUPPREFIX=SpotifyBackup
(Backup your library everyday at 2:00PM)
BACKUPHOUR
: Optional, (Integer: 0 to 23) hour of publish everydayBACKUPRETENTION
: Optional, (Positive Integer) Number of backup files to retain. Older files over this number are deletedBACKUPPREFIX
: Optional, (String) First part of the backup file names
To restore your Spotify Library, you need to run the image in interactive mode (using your volume):
docker run -it --rm -v spotifybackup:/data --entrypoint pwsh domochip/spotifybackup
Then use these commands:
Import-Module Spotishell
Restore-Library -Path '/data/SpotifyBackup-2023-05-11-01-00.json'
Exit