[Tutorial] How to sync reading progress for Okular across computers?

I have identical filesystem structure across several computers, and I want to sync my reading progress. I use Okular to read documents.

How to achieve this?

Okular saves information about the last read page in ~/.local/share/okular/docdata.

We want to sync this directory. I will use MEGAsync, but you are free to choose your favorite cloud storage service.

Create a new directory okular_docdata inside MEGAsync directory, and symlink them.

(Of course, you can set the name and location of the symlinked directory according to your preference.)

cd /path/to/MEGAsync
mkdir okular_docdata
mv ~/.local/share/okular /path/to/MEGAsync/okular_docdata/
ln -s /path/to/MEGAsync/okular_docdata/okular /home/username/.local/share/okular

Repeat the same in all the computers.

Afterwards, your reading progress will be synced when you run the MEGAsync desktop client.

Here is how to do the same for Foliate ebook reader.