16.4 Synchronizing Site Files
As you might suspect when you keep two sets of files桳ocal Folder and Remote
Site梚t's easy to lose track of which files are the most recent. For example, say you
finish your Web site and move all the files to the Web server. The next day, you notice
mistakes on a bunch of Web pages, so you make corrections on the copies in your
local site. But in your rush to fix the pages, you didn't keep track of which ones you
corrected. So although you're ready to move the corrected pages to the Web Server,
you're not sure which ones you need to transfer.
NOTE
The new "Select Recently Modified" files command is another option for this scenario (see Section 16.2.)
When you use the Check In/Check Out feature described in Section 16.3, you avoid this
problem altogether. Using that system, the version on the Web server is always considered
the latest and most definitive copy?span class="docEmphasis">unless you or someone else has checked
that file out. In that case, whoever checked the file has the most recent version.
But if you're operating solo, for example, and don't use the Check In/Check Out feature,
you may get good mileage from the Synchronize command, which lets you compare
the remote and local sites and transfer only the newer files in either direction. (In fact,
since the Synchronize command uses the Get and Put methods of transferring files,
don't use it if you're also using Check In and Check Out [see Section 16.3.1.])
To synchronize your sites:
Right click anywhere inside the Files panel. From the contextual menu that appears
select Synchronize.
The Synchronize Files dialog box appears (see Figure 16-13).
Using the Synchronize menu, specify the files to update.
You can either synchronize all files in the current Web site, or just files you've selected
in the Local Folder list. This last option is good when you have a really big
site and you want to limit this operation to just a single section of the site梠ne
folder, for example. For site file selection techniques, see Section 14.1.5.2. Using the Direction pop-up menu, choose where you'd like to copy newer files.
You have three choices. Put newer files to remote updates the Web server with any
newer files from your local site folder. It also copies any new files on the local site
to the remote site. Use this option when you've done heavy editing to the local site
and you want to move all new or modified pages to the Web server. Get newer files from remote does just the reverse: it updates your local site folder
with any newer (or new) files from the remote site. Here's one instance where the
synchronize feature comes in handy in team-design situations. If you've been out
of the office for a while, click this option to download copies of the latest site files.
(Note that this doesn't check any files out; it merely makes sure you have the latest
files for your own reference.) Get and put newer files is a two-way synchronization. Any new files on the local
site are transferred to the remote site and vice versa. The result is that both "sides"
contain the latest files. Turn on the Delete checkbox, if desired.
The wording of this option reflects the option you selected in the previous step. If
you're moving newer files to the remote site, it says "Delete remote files not on local
drive." It's a useful option when, for example, you've spent the afternoon cleaning
up the local copy of your site, deleting old, orphaned graphics files and Web pages,
for example, and you want Dreamweaver to update the Web server to match. If you chose to transfer newer files from the remote site, Dreamweaver lets you
"Delete local files not on remote server." Use this feature when your local site is
hopelessly out of date with the remote site. Perhaps you're working on the site
with a team, but you've been on vacation for two months (this is, of course, a
hypothetical example). The site may have changed so significantly that you want
to get your local copy in line with the Web site. NOTE
Of course, you should proceed with caution when using any command that automatically deletes
files. There's no Undo for these delete operations, and you don't want to accidentally delete the only copy
of a particular page, graphic, or external Cascading Style Sheet.
If you chose the "Get and put new files" option in step 3, the Delete checkbox is
dimmed and unavailable. This option truly synchronizes the two; Dreamweaver
copies newer files on the remote site (including files that exist on the Web server
but not on your computer) to your local site, and vice versa. Click Preview to begin the synchronization process.
Dreamweaver connects to the remote site and compares the two sets of files梚f
your site is large, a time-consuming process. When it finishes, the Synchronize
preview window appears (see Figure 16-14), listing which files Dreamweaver will
delete and which it will transfer. Turn off the Action boxes next to any files you don't want Dreamweaver to
touch.
For example, if you realize that Dreamweaver is going to delete a file that you
know you need, uncheck the box next to that file. When you do this, "skip" appears
next to the file in the Status column (see Figure 16-14). This is your last chance
to determine which files you want to transfer and delete, and which you want to
leave untouched.
Click OK to proceed, or Cancel to stop the synchronization.
If you click OK, Dreamweaver commences copying and deleting the chosen files.
If you want to stop this process, click the red Stop icon in the Synchronize window
(see Section 16.2.2). Click Close.
|