[Faq] Database broken : Import old settings

Frequently asked questions. Tutorials, tips and tricks.
jonnymnemo
Contributor
Contributor
Posts: 26
Joined: 13 Dec 2012, 14:04
Has thanked: 3 times
Been thanked: 6 times

[Faq] Database broken : Import old settings

Unread post 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 !
These users thanked the author jonnymnemo for the post (total 3):
adminMadsonicMatt Zornig
Rating: 23.08%
magikbus
Posts: 6
Joined: 21 Feb 2013, 14:03
Has thanked: 0
Been thanked: 0

Re: [Faq] Database broken : Import old settings

Unread post 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.
omoanya
Posts: 18
Joined: 13 Jan 2014, 05:49
Has thanked: 0
Been thanked: 0

Re: [Faq] Database broken : Import old settings

Unread post 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 ?
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: [Faq] Database broken : Import old settings

Unread post 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...
Post Reply