I've just discovered Atuin - a tool for syncing, searching, and backing up shell history - and it's a game-changer for me.
I didn't know about it before, but there's even a FreeBSD package available. I'm testing it on my computer now, and tomorrow I'll set it up on my server for syncing.