Page 1 of 1

[Faq] Database broken : Import old settings

Posted: 13 Dec 2012, 21:10
by jonnymnemo

Sometimes, especially when you upgrade or tweak madsonic, you can break the database.


!!! Before upgrading, always backup your madsonic folder !!!

If the database breaks, you can recover some settings :

Users (with their password) and their settings:

They are kept in the madsonic.script file. (steps 1 to 3 are only needed if you didn't remove the madsonic folder before reinstalling)

1. stop madsonic service
2. rename the madsonic/db directory
3. restart madsonic service : a new database is created.
4. open the old madsonic.script file (in the directory you renamed)
5. select the lines you want to keep
  • INSERT INTO MUSIC_FOLDER VALUES...
    INSERT INTO USER VALUES...
    INSERT INTO USER_ROLE VALUES ...
    INSERT INTO USER_SETTINGS VALUES ...
6. in your madsonic webpage, replace index.view with db.view
7. paste the selected lines

Now you should have your old user settings

Starred songs or albums :

You can't import the starred albums or songs from subsonic.script, because when you recreate the database, each song will have a new ID !!!

If you want to backup these BEFORE upgrading, there is a workaround :

- create a playlist with all your starred songs
- export the playlist

When you have to recreate the database, you will just have to import this playlist and star each song.

Same thing for the starred albums : you create a separate playlist, and put one song of each album, then star the album !

Playlists :

Old playlists (up to 4.6) are stored in a folder, so there's no problem to recover them.
New playlists (since 4.7beta1) are stored in the database. If you want to keep them just in case, you have to export them.


If you have some more tips for other settings, don't hesitate to add them !

Re: [Faq] Database broken : Import old settings

Posted: 03 Mar 2013, 19:35
by magikbus
Okay I had made a copy of my Subsonic folder before installinmg the Madsonic upgrade, But I was having some issues with the service and wanted to revert back to Subsonic. So I uninstalled Madsonic, but then my database was corrupted and I was getting the java.lang.IllegalStateException error. So I uninstalled everything and tried to reinstall and now nothing works. Is it possible to just start from scratch? If so how? Please help. I am running Windows 7.

Figured this out. Apparently there are two Subsonic folders (I did not know). One at the C drive level and one at the Program Files level both need to be deleted to start from scratch.

Re: [Faq] Database broken : Import old settings

Posted: 28 Jan 2014, 20:45
by omoanya
Im not as concerned with the Starring as I am with the comments. I have been entering comments about recordings and then lost them all when I had to change servers. Any idea how I can export comments as well as Stars ?

Re: [Faq] Database broken : Import old settings

Posted: 28 Apr 2015, 18:54
by DoCC
jonnymnemo wrote:

Playlists :

Old playlists (up to 4.6) are stored in a folder, so there's no problem to recover them.
New playlists (since 4.7beta1) are stored in the database. If you want to keep them just in case, you have to export them.


If you have some more tips for other settings, don't hesitate to add them !


mmh in 5.x playlists are stored or better backupped again in a folder such as /var/playlists
but even if started with root ( you normaly should not do this ) this folder is not autocreated.
if you have forgotten setting up a proper pl folder , you will loose em...