Skip to content

Instantly share code, notes, and snippets.

@keriati
Created January 19, 2025 16:39
Show Gist options
  • Save keriati/e87d24ba1d2442b3c6fa49dc380b1d8b to your computer and use it in GitHub Desktop.
Save keriati/e87d24ba1d2442b3c6fa49dc380b1d8b to your computer and use it in GitHub Desktop.
Radarr database movie exporter script
#!/bin/bash
DB_FILE="radarr.db"
OUTPUT_FILE="movies.json"
echo "[" > "$OUTPUT_FILE"
first=1
sqlite3 -noheader "$DB_FILE" "
SELECT json_object('imdb', mm.ImdbId, 'tmdb', mm.TmdbId, 'title', mm.Title)
FROM MovieMetadata mm
INNER JOIN Movies m ON m.MovieMetadataId = mm.Id
WHERE mm.ImdbId IS NOT NULL AND mm.TmdbId IS NOT NULL AND mm.Title IS NOT NULL;
" | while IFS= read -r row_json; do
if [ $first -eq 1 ]; then
echo " $row_json" >> "$OUTPUT_FILE"
first=0
else
echo " ,$row_json" >> "$OUTPUT_FILE"
fi
done
echo "]" >> "$OUTPUT_FILE"
echo "Export complete: $OUTPUT_FILE"
@keriati
Copy link
Author

keriati commented Jan 19, 2025

This script exports the list of movies from Radarr.

It needs the radarr.db file that can be extracted from a radarr backup.

The movies.json can then be imported to another Radarr instance using an import list with the format StevenLu Custom.
(the movies.json needs to be hosted for this on a URL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment