Homepage    |    GitHub    |    API    |    FAQ

Moving Joplin database on macOS

This has been discussed on the forum several times before, so I apologize for bringing it up yet again in a new topic. However, I am in need of some clarifications. I hope this is ok.

I use Joplin 2.4.9 on macOS Catalina, I do not use sync.

I would like to move the Joplin database and resources to an external drive instead of the standard location on the internal drive.

I have seen Laurent, Tessus and others mention the possibility of moving the directory to for instance a VeraCrypt container as a way of password protecting the notes in Joplin. This is what I want to accomplish.

In this topic Tessus wrote about the mv + ln commands. But I've also seen the --profile command discussed a lot. I haven't figured out when to use what since the use cases varies slightly in these topics at the same time as the OS shifts from macOS to Linux to Windows.


Step by step (if anyone feels patient enough), how would I go about this? After stopping all running Joplin processes I run exactly what in terminal?

The old location is ~/.config/joplin-desktop and the new location would be /Volumes/the_external_drive/folder/folder/_joplin


And one last question. To quote Laurent:

The --profile flag is undocumented, and unsupported, for a good reason.

Would my use case be relatively safe and stable?

After searching some more I have gathered that the symlink alternative is preferred over the --profile flag for macOS.

Creating a symlink was simple enough, as per the linked post from Tessus:

  • Stop all running Joplin processes
  • Open Terminal, and run:
mv ~/.config/joplin-desktop /new/path

ln -s /new/path/joplin-desktop ~/.config/joplin-desktop
  • Start Joplin, and make sure the external drive is mounted each time Joplin is launched

It seems to work well. I am sure this is real basic stuff for most of you but it's all new to me. Have I missed anything? And what would happen if the external drive was accidently removed while Joplin was running?

Hi snd. I actually wanted to reply to your original post, but I never got around to it until now.

Yes, using symlinks is preferred, because you do not have the start the app manually or add another start command that includes the --profile parameter. You can just click the icon as you normally would.

No, you did not.

Usually resources in use are locked and can't be removed unless you phsically unplug them (hard disk, SSD, memory stick).
But in such a case Joplin would have a problem. I don't know what exactly would happen though, I never tried. (I will try when I get to it.) Joplin uses the info in this particular directory to function properly. Your notes, resources, settings, everything is in that dir. If you remove it, Joplin won't have this data anymore. It's the same as driving a car and removing the tires and the steering wheel. Probably not a good idea. :wink:

I've never tried either, but I guess nothing too bad would happen if the drive is suddenly removed because most transactions are atomic in Joplin. In general the app never expects anything to work nicely or the app to be closed properly. SQLite would also handle this properly by committing or rollbacking any transaction based on the log journal the next time the app is started.

You wouldn't want to plug back the drive while the app is still running though because in that case you'd have data corruption due to the difference between in-memory cache and the content of the db.

Probably a good thing you didn't reply immediately since I got some time to look around a bit more for myself (which I should have done in the first place).

Yeah, that problem seems unlikely now that I read what you wrote – the volume wouldn't eject properly and thus I couldn't just accidentely forget that Joplin was running. It's an unlikely scenario that it would be yanked out as well, and if so that's what backups are for I guess!

Sounds good then :+1: I´ll remember to not plug it back in immediately if that ever happens.

By the way, I really appreciated the recent update with the maximum width for the editor and centered text. It enhanced the writing experience a lot. I left Evernote and Bear due to privacy concerns, and now after experimenting with some plugins recently I wouldn't want to go back even if they were on equal footing on that front. Joplin being on the internal drive was the only issue I had with the app since I let others borrow my computer a little here and there during the day, which is now resolved.

Thank you both for your replies!

1 Like

You can plug it it right away as long as you kill Joplin first.

But I think you should be fine unless your cat tries to eat the cable...

1 Like