Migrating Users & Playlists.......

Need help? Post your questions here.
hogfan
Posts: 5
Joined: 24 Apr 2013, 03:46
Has thanked: 0
Been thanked: 3 times

Migrating Users & Playlists.......

Unread post by hogfan »

I want to upgrade to 5.1, but I don't want to have to re-create all my users and playlists. I know how to manually backup the playlists. Is there an easy way to backup and re-import my users into the new installation?

-hogfan
gurutech
Contributor
Contributor
Posts: 323
Joined: 02 Jan 2013, 04:56
Has thanked: 11 times
Been thanked: 105 times

Re: Migrating Users & Playlists.......

Unread post by gurutech »

If you are doing an upgrade, you won't lose any settings (depending on what version you are upgrading from). See the installation notes in the forum to see if you will need to "rename" your data files from "subsonic.???" to "madsonic.???". (You still shouldn't lose any settings, but renaming the files is mandatory if upgrading from an older version.)
These users thanked the author gurutech for the post:
Madsonic
Rating: 7.69%
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: Migrating Users & Playlists.......

Unread post by DoCC »

As given in the DL section of 5.1 it is highly NOT recommended to upgrade your installation.
You have to start from scratch.

the only thing worked til now is to copy some usersettings from the old .script file to the new one.

EDIT : i'm talking 'bout the /var/madsonic/db/ .script files

What you should do is following these steps :
- backup the old .scripts file
- install the new version
- start the server
- login with admin:admin to your new panel
- stop the server
- open the old .scripts file and the new one
- search for stuff like

Code: Select all

INSERT INTO USER VALUES('default','enc:61393363616436643634363331373762333265393733383230306465306562393436626539656331',0,0,0,FALSE,NULL,0,TRUE,'#default user')
INSERT INTO USER VALUES('demo','enc:31396137656631313834343635373965343765653765656531333366386439393137636131343562',0,0,0,FALSE,NULL,0,TRUE,'#demo user')
!! The older .scripts file has fewer digits in the 'enc:xxxxxxxxxxxxx' section !! leaving this as is works fine.
In order to make the old useraccounts work you have to add ,NULL or ,'some shit' on the left side of the tailing )

- save new scripts file
- start server

EDIT : dont forget to reassign a new admin password. the warning at the loginscreen disappears only after initial pw change of admin... even if you had an other value copied from your old file....

now you can login with old credentials .......... only if you use Madsonics own loginsystem.
// the usersettings are available, the admin has to enable some features AGAIN like " is allowd to play" and so on. the specific userpassword may has to changed //

There will be NO statistical data anymore, these lines are stored at the end of the .script file but have changed in simantics. no way to get around this.
you have to refill your last.fm acc if you use one.
settings concerning theme and stuff like this is also thrown away ...
These users thanked the author DoCC for the post (total 2):
graewulfdiablo2424
Rating: 15.38%
graewulf
Posts: 5
Joined: 05 Dec 2013, 21:58
Has thanked: 3 times
Been thanked: 3 times

Re: Migrating Users & Playlists.......

Unread post by graewulf »

There is a slightly simpler way to do this:


What you should do is following these steps :
- backup the old .scripts file
- install the new version
- start the server
- login with admin:admin to your new panel
- stop the server
- open the old .scripts file
- search for stuff like

Code: Select all

INSERT INTO USER VALUES('default','enc:61393363616436643634363331373762333265393733383230306465306562393436626539656331',0,0,0,FALSE,NULL,0,TRUE,'#default user')
INSERT INTO USER VALUES('demo','enc:31396137656631313834343635373965343765653765656531333366386439393137636131343562',0,0,0,FALSE,NULL,0,TRUE,'#demo user')
In Madsonic, click the DB button
copy and paste the section from above into the box in the DB window.
Delete the default accounts from the list (Admin, Guest, Demo, Default)
Append ,'' before the )

Code: Select all

INSERT INTO USER VALUES('default','enc:61393363616436643634363331373762333265393733383230306465306562393436626539656331',0,0,0,FALSE,NULL,0,TRUE,'#default user','')
INSERT INTO USER VALUES('demo','enc:31396137656631313834343635373965343765653765656531333366386439393137636131343562',0,0,0,FALSE,NULL,0,TRUE,'#demo user','')
Click "OK"

Your users have been added.

Go into settings and set the users permissions.
These users thanked the author graewulf for the post (total 2):
DoCCdiablo2424
Rating: 15.38%
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: Migrating Users & Playlists.......

Unread post by DoCC »

yeah you are right,
i guess Mad is able to build a proper piece auf software. but my expierience tells me, that online and realtime manipulation of db is an risky operation.
since then i try to manage smaller things like this manually ^^
jsgates
Posts: 54
Joined: 22 Oct 2013, 21:53
Has thanked: 0
Been thanked: 15 times

Re: Migrating Users & Playlists.......

Unread post by jsgates »

This is good info. What would be nice would be a user migration script of some sort, like an option in Settings to "Export Users", "Playcounts", "Comments", etc. And then when you install a new version, an option in Settings to Import that data. This is one of the big issues when upgrading Madsonic........not losing all your stuff. Playlists are fine now since the newer versions allow you to export and import & restore playlists.
jsgates
Posts: 54
Joined: 22 Oct 2013, 21:53
Has thanked: 0
Been thanked: 15 times

Re: Migrating Users & Playlists.......

Unread post by jsgates »

I can't import my users. When trying to do so I get this error:


integrity constraint violation: foreign key no parent; FK_GROUP_ID table: USER
jsgates
Posts: 54
Joined: 22 Oct 2013, 21:53
Has thanked: 0
Been thanked: 15 times

Re: Migrating Users & Playlists.......

Unread post by jsgates »

Figure it out by querying the Users table. I had custom access groups before an the IDs were invalid. Setting the groupid field to zero fixed the issue and I was able to import.
These users thanked the author jsgates for the post (total 2):
DoCCMadsonic
Rating: 15.38%
richbach11
Posts: 1
Joined: 10 Apr 2018, 16:33
Has thanked: 0
Been thanked: 0

Re: Migrating Users & Playlists.......

Unread post by richbach11 »

You can give a try to MusConv tool, transfer your tracks and playlists to Apple Music, Spotify, Google Music and more for free.
Annie_Yazbeck
Posts: 1
Joined: 25 Mar 2019, 11:28
Has thanked: 0
Been thanked: 0

Re: Migrating Users & Playlists.......

Unread post by Annie_Yazbeck »

Could I confirm which music source your music files are from? If they are Spotify music and playlists, to backup Spotify playlists, it could be much easier than other streaming music source. Because there is a professional Spotify Music Downloader that can not only download Spotify files offline but also convert them to common audio tracks so that you can easily transfer them to other devices and backup them in USB drive, etc. as you like.
It's very easy to operate. You can have a try to migrate playlists and your accounts. If your audio files are from other sources, please let me know and I will try my best to give further assistance.
Post Reply