This is a question that get asked sometimes. Since it has such a good title, I'd suggest keeping just the original post, and add this answer for future reference (if it works):
To do this, log in to your old Subsonic setup. Go to
http://_yourserver_/db.view.
Type this, press OK and copy the output:
- Code: Select all
select 'insert into user(username, password, bytes_streamed, bytes_downloaded, bytes_uploaded, ldap_authenticated, email) values (''' + username + ''',''' + password + ''',''' + bytes_streamed + ''',''' + bytes_downloaded + ''',''' + bytes_uploaded + ''',''' + ldap_authenticated + ''',''' + email + ''');' from user where username != 'admin'
Then type this, press OK and copy the output:
- Code: Select all
select 'insert into user_role(username, role_id) values (''' + username + ''',''' + role_id + ''');' from user_role where username != 'admin'
Then type this, press OK and copy the output:
- Code: Select all
select 'insert into user_settings(USERNAME, LOCALE, THEME_ID, FINAL_VERSION_NOTIFICATION, BETA_VERSION_NOTIFICATION, MAIN_CAPTION_CUTOFF, MAIN_TRACK_NUMBER, MAIN_ARTIST, MAIN_ALBUM, MAIN_GENRE, MAIN_YEAR, MAIN_BIT_RATE, MAIN_DURATION, MAIN_FORMAT, MAIN_FILE_SIZE, PLAYLIST_CAPTION_CUTOFF, PLAYLIST_TRACK_NUMBER, PLAYLIST_ARTIST, PLAYLIST_ALBUM, PLAYLIST_GENRE, PLAYLIST_YEAR, PLAYLIST_BIT_RATE, PLAYLIST_DURATION, PLAYLIST_FORMAT, PLAYLIST_FILE_SIZE, LAST_FM_ENABLED, LAST_FM_USERNAME, LAST_FM_PASSWORD, TRANSCODE_SCHEME, SHOW_NOW_PLAYING, SELECTED_MUSIC_FOLDER_ID, PARTY_MODE_ENABLED, NOW_PLAYING_ALLOWED, WEB_PLAYER_DEFAULT, AVATAR_SCHEME, SYSTEM_AVATAR_ID, CHANGED, SHOW_CHAT) values (''' + USERNAME + ''',' + ifnull('''' +LOCALE+'''', 'NULL') +',' + ifnull('''' +THEME_ID+'''', 'NULL') +',' + ifnull('''' +FINAL_VERSION_NOTIFICATION+'''', 'NULL') +',' + ifnull('''' +BETA_VERSION_NOTIFICATION+'''', 'NULL') +',' + ifnull('''' +MAIN_CAPTION_CUTOFF+'''', 'NULL') +',' + ifnull('''' +MAIN_TRACK_NUMBER+'''', 'NULL') +',' + ifnull('''' +MAIN_ARTIST+'''', 'NULL') +',' + ifnull('''' +MAIN_ALBUM+'''', 'NULL') +',' + ifnull('''' +MAIN_GENRE+'''', 'NULL') +',' + ifnull('''' +MAIN_YEAR+'''', 'NULL') +',' + ifnull('''' +MAIN_BIT_RATE+'''', 'NULL') +',' + ifnull('''' +MAIN_DURATION+'''', 'NULL') +',' + ifnull('''' +MAIN_FORMAT+'''', 'NULL') +',' + ifnull('''' +MAIN_FILE_SIZE+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_CAPTION_CUTOFF+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_TRACK_NUMBER+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_ARTIST+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_ALBUM+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_GENRE+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_YEAR+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_BIT_RATE+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_DURATION+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_FORMAT+'''', 'NULL') +',' + ifnull('''' +PLAYLIST_FILE_SIZE+'''', 'NULL') +',' + ifnull('''' +LAST_FM_ENABLED+'''', 'NULL') +',' + ifnull('''' +LAST_FM_USERNAME+'''', 'NULL') +',' + ifnull('''' +LAST_FM_PASSWORD+'''', 'NULL') +',' + ifnull('''' +TRANSCODE_SCHEME+'''', 'NULL') +',' + ifnull('''' +SHOW_NOW_PLAYING+'''', 'NULL') +',' + ifnull('''' +SELECTED_MUSIC_FOLDER_ID+'''', 'NULL') +',' + ifnull('''' +PARTY_MODE_ENABLED+'''', 'NULL') +',' + ifnull('''' +NOW_PLAYING_ALLOWED+'''', 'NULL') +',' + ifnull('''' +WEB_PLAYER_DEFAULT+'''', 'NULL') +',' + ifnull('''' +AVATAR_SCHEME+'''', 'NULL') +',' + ifnull('''' +SYSTEM_AVATAR_ID+'''', 'NULL') +',' + ifnull('''' +CHANGED+'''', 'NULL') +',' + ifnull('''' +SHOW_CHAT+'''', 'NULL') +');' from user_settings where username != 'admin'
Make a backup of your settings folder, and remove it to start off with a fresh database.
Install your new Subsonic version, and go to db.view again.
Type in the output from the previous three commands and press OK. Your users and their roles should now have been copied.