• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Moving collection/config

    Technical Help
    2
    3
    215
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      techge last edited by techge

      Hello,

      I'd like to move my setting and collection folder to another user account and have trouble to do that without losing collection information like ratings.

      What I tried to do:

      • copy all files in /home/olduser/Music to /home/newuser/Music
      • copy .local/share/strawberry, .config/strawberry and .cache/strawberry to the corresponding folders of the new user

      As the music folder collection path is basically changing, strawberry re-scans another folder and thus seems to ignore the previously collected ratings. I do not like to store the information in song tags. Is there any idea how I can move my collection without losing information?

      Does strawberry accept relative paths? Maybe this would help me... 🤔

      I am using ArchLinux on one and Fedora 34 on the other machine, both using version 1.x.

      Thanks in advance for any help!

      1 Reply Last reply Reply Quote 0
      • O
        OriNOVet last edited by OriNOVet

        Yes, you can move your music, or copy it.
        First, you should copy the library: cp -R /home/olduser/Music /home/newuser/Music
        Then look for the database. This is saved in .local/share/strawberry/strawberry/strawberry.db.
        This is a SQLite database. You can use "DB Browser for SQLite" to such files or the shell ith sqlite3 command, but its easier with the editor.

        In the db there is a table "songs". In this table, the column 'url' saves the path to your music file and the column 'rating' holds the ratings for the song. You can use standard SQL syntax to edit the fields. You have to edit the path to the new path. Be careful to identify the correct song, since there is no unique id linked to the song.

        For example you can get a list with the following syntax (in tab "execute SQL"):

        SELECT title, album, artist, track, disc, url, rating
        FROM songs;
        

        Save the result as CSV file. Open the CSV file with Libre Office Calc (or any other calculation software, like Excel).

        Add a new column in the csv file and enter the following formula (Keep the Quotes):

        =CONCAT("UPDATE songs SET url = '";F2;"' WHERE title = '";A2;"' AND album = '";B2;"' AND artist = '";C2;"' AND track = ";D2;" AND disc = ";E2;";")
        

        Use autofill for all the other entries. This creates a new set of SQL commands in this new column to UPDATE the mentioned table.

        Copy the database to the new location, DON'T open strawberry. Open the database on the new location with the SQLite editor. Paste new created SQL commands in the execute tab and execute the commands. Save the database/write the changed entries. Close the SQLite editor.

        Open Strawberry on the new profile, ratings and path should now be edited. To be save, you can create backups of the database files.

        Sounds complicated, but it should work. I have migrated my Media Monkey data from Windows by a similar way, and it worked like a charm.

        UPDATE: Sorry forgot that the path/url changes, during this operation. In this case, you can search and replace in the textfile, to change the parts of the path, which changes.

        O 1 Reply Last reply Reply Quote 0
        • O
          OriNOVet @OriNOVet last edited by

          @orinovet

          maybe its much easier in your case. after thinking again, you should also be succesfull by using a update sql like this:

          update songs set url = 'newpath' where url = 'oldpath';
          

          in the new column within libre office. set the fieldnames according to your current table. ratings are already set in your case, you have only to update the path.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB | Contributors