Problem
If your application log keeps showing the following message every time replication should run, and no amount of service restarts fixes it:
[Worker #X] INFO Toems_Service.Workflows.FolderSync A Replication process is already in progress.
...the cause is a stuck flag in the database. At some point in the past, the replication job was interrupted mid-run (service restart, IIS app pool recycle, crash, etc.) before it could clean up after itself. This leaves a persistent True value in the admin_settings table that survives every restart indefinitely, causing every scheduled replication attempt to immediately abort.
Fix
Connect to your theopenem MariaDB database using HeidiSQL, MySQL Workbench, or any other SQL client and run the following:
First, confirm the stuck flag:
SELECT * FROM admin_settings WHERE admin_setting_id = 98;
You should see "Replication In Progress" with a value of "True".
Then reset it:
UPDATE admin_settings
SET admin_setting_value = 'False'
WHERE admin_setting_id = 98;
Verify it was reset:
SELECT * FROM admin_settings WHERE admin_setting_id = 98;
It should now show "False".
After the fix
Trigger a manual replication from the Toems web UI and watch your application log. You should now see replication progressing normally and finishing with:
[Worker #X] INFO Toems_Service.Workflows.FolderSync All replication tasks complete
From this point on, the scheduled cron job will run normally and the flag will reset itself cleanly after each run.
Hope this saves someone else two years of manual syncing! 😄