Being a Linux user, that's not the best option for me, so I came up with another way. This one's not for the faint of heart, so be sure you've got some time on your hands and lots of patience. Here we go:
- Just like my method for exporting playlists from Google Play Music, importing them will require a rooted Android device. The exact method for doing this varies by device, so you'll need to Google it.
- This may seem obvious, but first of all you need to make sure all of your music is in Google Play Music. It can take a while, so if you haven't done this you should probably get crackin. These links should help:
- Playlist name
Based on the tools I've used to import data into a Sqlite database, I'd recommend that the data is in one of these formats:
- A text file where each row is on one line, the fields are separated by a unique character (like the pipe symbol: |), and the fields aren't quoted. For example:
Folk|Gregory Alan Isakov|Dandelion Wine Folk|Gregory Alan Isakov|That Moon Song
- A Microsoft Excel XML file. You don't need Excel to create this; free programs such as LibreOffice Calc work fine.
- Create temporary tables
create table "temp" ("Playlist Name" text, "Artist" text, "Title" text);
create table "temp2" ("Playlist Name" text, "Artist" text, "Title" text, "ClientPosition" integer primary key autoincrement);
- Import the data. This will vary depending how your playlists are formatted and what program you're using. If you're using Sqliteman:
- In the menu go to Database --> Import Table Data...
- Table to Import Into --> select temp
- File to Import --> Search... --> browse to your playlist file
- Select an appropriate separator under Column Separators
- Under Preview, you should see three columns with playlist name, artist, and title
- Click OK
If you're using the sqlite3 command:
- Define the separator between fields. If it's a pipe (|), you can skip this step. For example, to set the separator to a dollar sign:
sqlite> .separator $
- Then import the file (things will be easier if the file name doesn't have spaces):
sqlite> .import /path/to/playlists.txt temp
select temp."playlist name", temp.artist, temp.title from music join temp on music.artist=temp.artist and music.title=temp.title;
insert into temp2 ("playlist name", artist, title) select * from temp;
insert into lists ("Name", "_sync_dirty") select distinct "Playlist Name", '1' from temp2;
insert into listitems ("MusicId", "ListId", "ClientPosition", "_sync_dirty") select music.id as musicid, lists.id as listid, clientposition, "1" from music join temp2 on music.artist=temp2.artist and music.title=temp2.title join lists on "playlist name"=lists.name;
drop table temp;
drop table temp2;
- Long-press on one of the other files in the folder, like music.db-journal --> Permissions
- Make a note of the Owner and Group
- Now long-press on music.db --> Permissions
- Click on Owner --> App --> change it to the same owner as the other file you just looked at. You'll see a Google Play Music icon beside the owner, which will confirm you're picking the right one.
- Repeat the same thing for the group.
- This isn't completely necessary, but you can also uncheck all of the boxes in the Exec column, and uncheck the Global box in the Read column. In the bottom left it should say Octal: 0660.
- Click OK --> OK.