Importing data from clementine throws an error in sqlite3
-
Hi,
I just liked Clementine, now I'm forced to move to Strawberry and wanted to transfer all data from Clementine to Strawberry, following the guide on https://wiki.strawberrymusicplayer.org/wiki/Import_collection_library_and_playlists_from_Clementine. I get stuck at the commandINSERT INTO strawberry.playlist_items (ROWID, playlist, collection_id, title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, beginning, length, bitrate, samplerate, directory_id, url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, compilation_detected, compilation_on, compilation_off, compilation_effective, art_automatic, art_manual, effective_albumartist, effective_originalyear, cue_path, rating ) SELECT ROWID, playlist, library_id, title, album, artist, albumartist, track, disc, year, originalyear, genre, compilation, composer, performer, grouping, comment, lyrics, beginning, length, bitrate, samplerate, directory, COALESCE(filename, ) AS url, filetype, filesize, mtime, ctime, unavailable, playcount, skipcount, lastplayed, sampler, forced_compilation_on, forced_compilation_off, effective_compilation, art_automatic, REPLACE(art_manual, '.config/Clementine/albumcovers','.local/share/strawberry/strawberry/collectionalbumcovers') AS art_manual, effective_albumartist, effective_originalyear, cue_path, rating FROM clementine.playlist_items WHERE type = 'Library';sqlite3 throws an error:
Parse error near line 25: near ")": syntax error lerate, directory, COALESCE(filename, ) AS url, filetype, error here ---^I don't know how to remedy this, I am not well versed in SQL, I only know that COALESCE takes at least two arguments, and I don't think that a space is considered an argument. But what else should be there?
Thanks for your help! -
I did a little bit of research and tried
COALESCE(filename,NULL) AS url,which made the process work without an error, but the result isn't what I hoped for. After completing all steps given on the above mentioned Wiki page, when starting strawberry, it's still empty, i.e. there is no library, no playlists etc. The entire process to import the data from Clementine didn't work, it seems. Or my solution to the COALESCE-issue isn't the right one?
-
-
The script here:
was changed in a commit on Jan. 27, 2025:
https://github.com/strawberrymusicplayer/strawberry/commit/055cb413c9f81723e39bfbfc1675456a6d9bd3a5
The instructions on the wiki page here:
https://wiki.strawberrymusicplayer.org/wiki/Import_collection_library_and_playlists_from_Clementine
Were edited on Mar. 21, 2026.
Line 143 in the git repo script:
CASE WHEN filename IS NULL THEN '' ELSE filename END,was replaced with:
COALESCE(filename, ) AS url,and the line below was added to the wiki instructions (would be at line 157 in the script, but it's not):
REPLACE(art_manual, '.config/Clementine/albumcovers','.local/share/strawberry/strawberry/collectionalbumcovers') AS art_manual,It's been a while since I've done sqlite stuff, but this line:
SELECT ROWID, name, last_played, special_type, ui_path, is_favorite, dynamic_playlist_type, dynamic_playlist_data, dynamic_playlist_backend FROM clementine.playlists WHERE dynamic_playlist_type ISNULL;in the script, line 72, and in the wiki instructions contains a possible error at the end of the line with the 'ISNULL' operator and should be this:
SELECT ROWID, name, last_played, special_type, ui_path, is_favorite, dynamic_playlist_type, dynamic_playlist_data, dynamic_playlist_backend FROM clementine.playlists WHERE dynamic_playlist_type IS NULL;I'll let @jonas be the final arbiter since he will have to make time to fix it.
You may want to try changing some of those instructions to see if that produces a different outcome.
Remember to make a backup of your databases before you do anything just in case if all of this knob-turning goes badly.