# How-To: Transfer Your Music Data From Last.fm to Libre.fm

If you are a Libre.fm user already (if not go sign-up at alpha.libre.fm) then you may want to transfer your scrobbled tracks from Last.fm.

A special note: this applies to Debian/Ubuntu-based GNU/Linux OS only. However, if you know how to run python scripts in Windows or Mac then theoretically it should be possible to do the steps below.

Let’s begin.

1. Go to LastToLibre page and download the following Python scripts: lastexport.py; libreimport.py; scrobble.py
2. Go to the folder where you saved the three files you downloaded
3. Make the files executable by typing these commands in the terminal:
chmod +x lastexport.py libreimport.py
4. Type:
./lastexport.py --user YOUR_LastFM_USERNAME
5. Wait for it to finish exporting your Last.fm data
6. Type:
./libreimport.py YOUR_LibreFM_USERNAME exported_tracks.txt

You’re done!

Take note, if the script encounter errors or Last.fm terminated your connection, the script will terminate. To continue from where the script stopped, simply type this command:

./lastexport.py -u YOUR_LastFM_USERNAME --page XXX

Replace XXX with the page number the script last exported. So, if you see in the terminal that it stopped at page 666 of 1200, then you should type:

chmod +x lastexport.py libreimport.py

Simple enough? Good! Now go start transferring your Last.fm data to Libre.fm!