[Faq] Database broken : Import old settings
Posted: 13 Dec 2012, 21:10
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 ...
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 !
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 !