16.4 Synchronizing Site Files

     

As you might suspect when you keep two sets of files ”Local Folder and Remote Site ”it'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 ” 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:

  1. 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 Synchronization command, you can copy newer files from your computer to the Web server, or get newer files from the remote site. (The Synchronization command is not available if you're using Visual SourceSafe.)
    figs/16_13.jpg
  2. 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 ”one folder, for example. For site file selection techniques, see Section 14.1.5.2.

  3. 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.

  4. 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.

  5. Click Preview to begin the synchronization process.

    Dreamweaver connects to the remote site and compares the two sets of files ”if 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.

  6. 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.

    The Synchronize window lets you preview any actions Dreamweaver intends to take to synchronize the files on your local and remote sites. You can deselect any actions you don't want, or simply back out of the whole process without making any changes by clicking Cancel.
    figs/16_14.jpg
  7. 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).

  8. Click Close.

    If you just want to identify newer files on the local site without synchronizing them (to run a report on them, for example), choose Edit Select Newer Local in the Files panel menu bar (Windows) or choose Site Site Files View Select Newer Local (Mac). Dreamweaver connects to the remote site and compares the files, then, in the Files panel's Local Folder list, highlights files on the Local site that are newer than their remote counterparts.

    You can also identify newer files on the remote site: Choose Edit Select Newer Remote from the Files panel menu bar (Windows) or choose Site Site Files View Select Newer Remote (Mac). As with the Synchronization command, these options are unavailable if you're using Visual SourceSafe (Section 16.1.5).

    You can also identify files on your computer that you've either created or modified within a given date range, using the new Select Recently Modified command described in Section 15.4.1.3.




Dreamweaver MX 2004. The Missing Manual
Dreamweaver MX 2004: The Missing Manual
ISBN: 0596006314
EAN: 2147483647
Year: 2003
Pages: 191

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net