Migrate Mendeley library and keep the file references

The following small guide helps to migrate the Mendeley library and the file paths of the linked PDFs. If you have a Mendeley account and all your synched files combined are not exceeding the space limit, then the files are synched through the Mendeley service.

If your collection became quite large, then you can copy the database file between the two computers. The problem however is, that in the database the paths to the files (mainly PDFs) are stored as absolute paths, which are not necessairly the same between the two machines, hence the links to the files are not working anymore.

The following guide shows how to replace the paths inside the Mendeley database. (This guide assumes that all the literature files are stored inside one folder)


1. Installation of Mendeley and SQLite Database Browser

Download and install Mendeley desktop and the SQLite Database Browser, to edit the Mendeley database file, to your second computer, where you want to migrate Mendeley.

 Mendeley desktop  SQLite Browser


2. Copy the database and the folder storing all the literature files

Copy your Mendeley Desktop database file on your first computer to the second computer. On Windows machines it is located inside the user folder in AppData\Local\Mendeley Ltd\Mendeley Desktop looking like this: <youremail@provider.com>@www.mendeley.com.sqlite (see: Article: Locate mendeley database).

Copy the folder storing all the literature (all PDF files etc) from your first computer to the second computer. In our example the literature of the first computer is stored in C:/Users/John/Documents/Mendeley/ and of the second computer the files will be stored in C:/Users/John/Documents/Literature/.


3. Edit the SQLite Database to store the new file paths

Open the <youremail@provider.com>@www.mendeley.com.sqlite database with the SQLite Browser.The paths to the files are stored in the table „files“ (see Fig. 1).

Figure 1. Files table of the Mendeley database


These old paths (old: file:///C:/Users/John/Documents/Mendeley/) need to be changed to the new location of the literature folder (new: file:///C:/Users/John/Documents/Literatuere/) with the following SQL query. This query replaces the string of the old path with the new one. After execution of the query, saving the SQLite database and restarting Mendeley Desktop the files should link correctly again (see Fig 2).

update Files set
localUrl = replace(localUrl, 'file:///C:/Users/John/Documents/Mendeley/', 'file:///C:/Users/John/Documents/Literature/')
localUrl like 'file:///C:/Users/John/Documents/Mendeley/';
Figure 2. Execute SQL query to change the paths of the Literature files

24 thoughts on “Migrate Mendeley library and keep the file references

  1. Thank you very much for your post. I have used mendeley successfully in several computers by storing my references and database files in a Dropbox Folder synced across the multiple devices. The file path for all computer is the same (e.g., C:Dropbox/Mendeley). Recently Mendeley was crashing in all computers. I migrated the DB file to Google Drive and pointed Mendeley to look for it in the new location, which now allows me to use Mendeley. However, my references are still in dropbox.

    I tried using your method to update the SQL file to be able to move my references to Google Drive. Unfortunately, I cannot get it to work. I will not update any of the registries.

    The following are the results:

    Query executed successfully: update Files set
    localUrl = replace(localUrl, ‚file:///C:/Dropbox/NCSU/Publications/‘, ‚file:///C:/GoogleDrive/NCSU/Publications/‘)
    localUrl like ‚file:///C:/Dropbox/NCSU/Publications/‘ (took 0ms, 0 rows affected)

    Can you provide some assistance?

  2. thanks a lot for this information, it was very helpful. Although I needed to tweak the script to make it work.

    I used the following:

    update Files set
    localUrl = replace(‚file:///C:/Users/jordi/Documents/biblio/‘, ‚C:/Users/jordi.Therminus15‘, ‚home/jordi‘);

  3. the correct script in prvious message should be:

    update Files set
    localUrl = replace(localUrl, ‚C:/Users/jordi/Documents/biblio/‘, ‚home/jordi/Documents/biblio/‘);

  4. Thanks a lot for this! It just saved me a lot of trouble after renaming a parent folder of my Mendeley library (god forbid!). Note: I was using the modification suggested by jordi.
    I’m getting really fed up with Mendeley lately, I’m dreaming of migrating to a different manager but am kind of locked in for the time being.

  5. Hi Guys,

    thanks a lot for your help. I had some troubles as there was a space in my new directory. The following command worked for me after some trial and error:

    update Files set
    localUrl = replace(localUrl, ‚file:///D:/Users/maleseal/Documents/Literature/‘, ‚file:///D:/Users/maleseal/OneDrive%20-%20Danone/My%20Documents/Literature/‘);

  6. How can I find the previous folder path? I finalized my employment and trying to change path to my new computer but I don’t remember the previous folder path? It must be stored somewhere in Mendeley but where?
    Can any of you help me?
    Thanks in advance.

  7. After installation of Mendeley in my new computer, it started automatically downloading the files of the references to a new folder (C:\Users\Hakan\AppData\Local\Mendeley Ltd\Mendeley Desktop\Downloaded) so the previous folder path (which I built in my previous computer) info is deleted (if I understand correctly). I had a deep multi-level grouping in my pdf files stored in my previous local drive (and I just copied everything to a new folder), thinking that I would only show the new (pdf) file location (the main folder) but as I understand: I missed that chance after Mendeley automatically downloaded the files to a new folder (re-changed the link between the Mendeley references and the all previous sub-folders) so my Mendeley database is broken?
    Or I am wrong? Can any of you help me fixing this issue? I have no expertise in SQL database or this SQlite data browser.

  8. Had to replace the quotation marks from the previous answers. This worked for me:

    update Files set
    localUrl = replace(localUrl, „file:///home/USER/10_Literature/“, „file:///home/USER/10_Literature/“);

  9. For my system, I had to use other quotation marks, namely „.
    update Files set
    localUrl = replace(localUrl, „file:///C:/Users/XY/Documents/Ref_Paper/“, „file:///D:/Ref_Paper/“);
    Thanks a lot!

  10. Oh, no. The quotation mark was changed from a simple upper one, inch like character, to lower and upper ones. This was not what I’ve written in my comment originally. Keep in mind to test all varieties of quotation marks.
    Good luck!

  11. Thanks very much indeed. The code suggested in the initial post worked like a charm, after I deleted lines 3 and 4

  12. @Hakan, this happened to me – I migrated to a new computer and it started downloading all my pdfs from the cloud. I closed Mendeley and copied the database file from my old „AppData“ folder on my old computer to the new computer, to the same location. When I reopened Mendeley the file paths were correct, because my new computer has the same profile/username. If it doesn’t you’ll likely have to use the database manager to change the paths. But it did replace the „cloud“ files with my local files successfully!

    Good luck.

  13. I tried this with SQLite portable, but when trying to open the Mendeley database it asks surprisingly for a passphrase. But my Mendeley password does not work ..:-( (checked it again and could log in to Mendeley website).
    Any ideas? Is there a standard password? Thanks for any input…

  14. Problem solved…but anyway weird and no idea why…
    But altogether it was easy and helped a lot…thanks for the code!

  15. When trying to open the data base in the DB broswer for SQlLite i got a message saying
    „please enter the key used to encryot the databse.
    If any of the other settings were altered for this databse file you need to provide this information as well.“

    And the it gives me a space to write down a password…

    Why is tis happening?
    thank you!

  16. I solved the passphrase problem by using the database file (@www.mendeley.com.sqlite) in the original folder and accessing it with admin rights, and then no passphrase was necessary. Before I used a copy of it on my desktop and had only user rights and this did not work (therefore perhaps a problem with user rights in windows? But just a guess.).

    And also not unimportant: The SQLLite data browser exists as portable version, so you don’t need to install it for a singe use.

  17. I have the same problem with password as Peter. The problem is, I do try to open the sqlite file from its original location. I can see no option to access it with admin rights (tried right-clicking on the file name and on the „open“ command). I’d appreciate any help.

  18. I have the same problem as Monika. I am trying to open the sqlite file from its original location. I have admin rights as well. Still I get the box to enter the passphrase. Cannot open the mendeley sqlite database. Any help appreciated.

  19. I have the same problem as the passphrase, also there is no option to open it with administrator rights

  20. I’m really loving the theme/design of your blog. Do you
    eber run inmto anny browser comatibility issues? A few
    off my blog readers have complained about my website nott working correctly in Explorer but looks great
    in Opera. Do you have any recommendations to help
    fix tis issue?

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.