Synchronizing Local and Remote Files
In Web development, sometimes it can get confusing managing versions of files. Where is the most recent file? This question is one that you'll probably ask yourself more than once throughout the development of a site. Fortunately, Macromedia has built a great feature into Dreamweaver called File Synchronization. This feature compares files between the local and remote side and determines which is the latest version. If the latest version lives on the local side, it will upload that file accordingly.
File Synchronization can also delete files on either the local or remote side, if the file doesn't appear in both versions of the site. You can apply the synchronize command to selected files, or apply it sitewide.
Follow these steps to synchronize your files. In this example we are going to synchronize only a few files; however, the process is the same if you want to synchronize an entire Web site.
Make sure your Site File panel is open and expanded. Press F8 on your keyboard if it is not visible. Select a couple of files that you want to synchronize.
Choose Site, Synchronize. The Synchronize dialog box opens.
Here in the Synchronize dialog box, if you wanted to sync the entire Web site, you would choose a Site Name from the list. In our case, we are going to choose Selected Local Files Only.
Set the direction of synchronization. You can choose Put Newer Files to Remote, which evaluates which files are newer on the local side and uploads whichever files Dreamweaver evaluated as being newer. The second choice is Get Newer Files from Remote. This option examines the files on the remote side; the files that are newer on the remote side get downloaded to the local side.
You can also choose Delete File Not on Local Drive, which will remove any local files that do have a counterpart on the remote side when using the Get Newer Files from Remote Side option. If you are using the Put Newer Files to Remote side option, the files on the remote side without a local equivalent will be removed.
When you are ready, click the Preview button. This starts the process of comparing files. This will be displayed in a Site dialog box for confirmation. If no files are mismatched (that is, no differences exist between files on the local and remote sides), Dreamweaver informs you that no synchronization is necessary.
You have the opportunity to uncheck the action that Dreamweaver will perform if you want to override what Dreamweaver found to synchronize.
When you are happy with the settings, click OK. You will see a progress bar indicating the progress Dreamweaver is making with the synchronization.
After the synchronization is complete, you can save a log of the actions performed by pressing the Save Log button.
One suggestion is to have all the developers and team members set their system clocks to equal the time of the server. This can be important if the server is in Boston and some team members are in Los Angeles. It's been my experience that Dreamweaver doesn't factor time zones.
File synchronization is a powerful way to automate the organization of your site files. It's especially useful when there is more than one person working on a site. I would also recommend that you use the Delete option with discretion, because it is an undoable act.