Synchronizing files across machines
You have 3 machines (let's say web servers) and want to synchronize files in a folder across all of them. You want file changes to propagate across these machines, meaning if:
- A new file is added to machine 1, it should automatically appear on machine 2 and 3
- An existing file is modified on machine 3, that change should appear on machine 1 and 2
- An existing file is deleted from machine 2, it should get deleted from machine 1 and 3
- You want to synchronize C:\wwwroot across machine 1, 2 and 3.
You can accomplish this task using the Two-way sync
feature in Syncrify. The following bullets show step-by-step instructions on accomplishing this task.
Introduce a 4th machine that acts as a broker. You install and configure the Syncrify server on this broker machine. Following assumption are made for the purpose of this example:
- The host name of this machine is sync.xyz.com
- A new user is created with firstname.lastname@example.org as login ID in Syncrify
- Password for this user is hiddenSecret
- Install the Syncrify client on machine 1, which is your primary web server.
- When the Syncrify client runs for the first time, it creates a default profile. Put some garbage values for Remote Server URL, Login Email and password and save this profile. You will NOT be using this profile for this example.
- Next, click Add Profile under the File menu.
- Enter the following values on the next screen.
|Remote Server URL:
||DO NOT check
Click here for a screen shot.
- Click Create Profile button to create a new profile
- Right click on the left hand panel and select Add folder/file from the popup menu.
- Select C:\wwwroot folder and click Ok. Click here for a screen shot.
- Click the Advanced tab and select Two-way sync for Direction. Click here for a screen shot.
- Click Backup to run a backup
Follow the same steps above to setup machine 2 and 3, with one difference:
- Check the box for Restore Profile when creating a new profile. Click here for a screen shot.
- After you click the Create Profile button, Syncrify will prompt you for the path where the wwwroot folder resides on this machine. Accept the default value if the location of this folder is C:\wwwroot is same on every machine.
Frequenty asked questions
Why do I need a broker machine?
Often users want to put the Syncrify server on one of the machine that is involved in synchronization. For example, machine 1 in the above example and have machine 2 and 3 run Syncrify Client.
Although this configuration is possible, it is not recommended for the following reasons:
- The Syncrify server creates temporary files on the server machine. Seeing these temporary files in your c:\wwwroot will definitely create confusion on a production machine.
- This can create synchronization problems. No one should be modifying files in the repository folder on the machine where the Syncrify server is running. Files in the repository should only be modified by Syncrify server. Consider a scenario where Syncrify client on machine 2 is running a backup and someone changes the contents of one file on machine 1. This can cause unpredictable behavior and can corrupt files.
- The repository path for the Syncrify server won't be C:\wwwroot. Meaning by default the backed up files are stored in
C:\Backup\email@example.com\WebSync\wwwroot folder. Although you can change the actual path on disk by using Repository path exceptions or Junction Points, having a 4th machine is a much cleaner alternative.