2016년 4월 23일 토요일

Syncing Mnemosyne default.db with Mnemosyne Android app

I am an avid user of the open-source spaced repetition software (SRS) Mnemosyne, which is developed by Peter Bienstman, who also released a free mnemosyne app for Android. The app makes Mnemosyne much more useful, as you can now do card reviews while waiting for the bus or riding the subway.

Mnemosyne stores all cards in the sqlite database file default.db which is normally located in $HOME/.local/share/mnemosyne/ on Linux machines and in C:\Users\username\Application Data\Mnemosyne\ or C:\Users\username\AppData\Roaming\Mnemosyne\ on Windows.

If you use mnemosyne on multiple computers (I use mnemosyne on a two computers at home and on a laptop at work), it is convenient to place your mnemosyne folder on Dropbox and then create a symlink from Dropbox to the default mnemosyne path. I detail how to do this on linux in the post Sharing mnemosyne cards across multiple machines using dropbox and symlinks.

If you do not create this symlink and just open a mnemosyne db file from a custom path ($HOME/foo/my.db for example) through the File -> Open menu, you will have no problems when using mnemosyne on that single machine.

Now enable the Sync Server on TCP port 8512 by selecting menu tab Settings -> Configure Mnemosyne -> Servers and check the box "Allow other devices to sync with this computer". Now open the mnemosyne Android app and enter the IP of your machine and try to sync. The sync will proceed, but 0 cards will appear on the Android app and the mnemosyne instance on your computer will also show 0 cards!

This is because the Mnemosyne Android app will always look for default.db in the default path, and will reset the Mnemosyne program on your PC to the default path. The way to avoid this problem is to create a symlink from your custom path to the default path.

References:

http://mnemosyne-proj.org/help/backups.php Default paths for mnemosyne