FSPBX replication - files/folders

marc8lange

New Member
Oct 29, 2018
13
0
1
In a previous post you outlined the batch file to sync the database for a HA setup.

Would you consider sharing a definitive list of folders you recomment sync with Syncthing as well, including the dehydrated folder in /etc and /etc/nginx as well as the various /var folders for fspbx, fusionpbx, and freeswitch?
 
Here are the most essential folders to sync. You can add any other folders you may find useful, too.


Code:
/usr/share/freeswitch/sounds/music

/var/cache/fusionpbx

/var/lib/freeswitch/recordings

/var/lib/freeswitch/storage

/var/www/fspbx/public/resources/templates/provision/
 
In a previous post you outlined the batch file to sync the database for a HA setup.

Would you consider sharing a definitive list of folders you recomment sync with Syncthing as well, including the dehydrated folder in /etc and /etc/nginx as well as the various /var folders for fspbx, fusionpbx, and freeswitch?
Hi
I cannot find mentioned post about batch file to sync the database and HA setup.
Please share if there is any guide about how to HA setup of FS PBX or Master/Master replication.

Regards
 
Last edited:
Here are the most essential folders to sync. You can add any other folders you may find useful, too.


Code:
/usr/share/freeswitch/sounds/music

/var/cache/fusionpbx

/var/lib/freeswitch/recordings

/var/lib/freeswitch/storage

/var/www/fspbx/public/resources/templates/provision/
Ok thank you for that list, I'll try these out.

Now how did you deal with the certs in both fusionpbx folder and dehydrated?

I ended up synching /etc/dehydrated and /etc/nginx in order for the certs to be present in both servers and for the .env file to use my FQDN

However it took a while to figure out i had to create move both /etc/dehydrated and /etc/nginx folders and create symlinks in order to sync those because permissions would not allow syncing.

After some 5 days of experimenting and not taking notes I think i have certs working. I think this chat would benefit from a full description to run HA database and files via synch.
 
alright...synching these system folders like /etc/dehydrated or even /usr/share/freeswitch/sounds/music is proving complicated.
I'm getting errors that write privilidge is not available, something like
Notice
2025-10-27 15:14:23: Failed to create folder root directory: mkdir /var/www/html/syncthing_test: permission denied
2025-10-27 15:14:23: Error on folder "/var/www/html/syncthing_test" (fcttg-ia4dg): folder path missing


I tried to change folder permissions, user permission / groups, chmoding, then i escalated to trying ACLs, then finally went nuclear by disabling hardening in systemd via:
  • sudo nano /lib/systemd/system/syncthing@.service, the commingting out the hardeing and reloading
  • sudo systemctl daemon-reload

Only removing hardening worked, but i didnt like the idea of removing this protection.
Eventualy found a bit of a compromise by moving these folders, given the new folders access to Syncthing and creating a symlink back to the original folder.

Its pretty messy. @pbxgeek how are you handling syncthing permissions of folders?
 
@marc8lange normally we see direcotries and files owned by www-data. This directory - /usr/share/freeswitch/sounds/music should sync without any issues. Make sure the dehydrated is also owned by the same user. I think you overcomplicated it a bit, or perhaps didn't set up Syncthing correctly. I normally run Syncthing under www-data permissions and it never has a problem accesing files with the same permissions. Maybe your service is running under something else, and that's why you are running into issues.

Your error mentioned this directory is missing /var/www/html/var/www/html/syncthing_test - I'm not sure what that directory is or why you are trying to sync it.