다음을 통해 공유


How to: Copy Web Site Files with the Copy Web Site Tool

This topic describes how to copy files from a local Web site to a remote Web site using the Copy Web Site tool in Visual Web Developer.

You can use the Copy Web Site tool in Visual Web Developer to copy files from a local site to a remote site or vice versa. You can copy selected files individually or copy all of the files for a site at once. Additionally, you can synchronize two sites, which copies files as required to be sure that both sites have identical copies of all files.

Note

You must have sufficient permissions to be able to read, write, create, and delete files on the remote site. If you are unsure, check with the administrator for the remote site.

For more information about the Copy Web Site tool, see Copying Web Sites with the Copy Web Site Tool.

To connect to a remote site

  1. On the Web site menu, click Copy Web Site.

    The Copy Web window is displayed with files from the currently open Web site in the Source Web Site list.

  2. From the Connect to list, select the site to connect to as the remote site. If the site that you want to connect to is not in the list, select Connect to... and then use the Open Web Site dialog box to connect to the site that you want to copy files to or from.

    When the Copy Web Site tool opens the remote site, it examines the files on both sites and indicates their status (New, Unchanged, Changed, or Deleted). If there are two different versions of a file, one on the source site and one on the remote site, an arrow points from the newer version to the older version.

    Note

    To see files that have been deleted, select the Show Deleted Files check box. The names of deleted files have a glyph next to them indicating that they have been deleted.

Removing a Connection

Connection information is persisted in Visual Web Developer. (The connection is live only while you are working with a site.) If you do not need to connect to a remote site any more, you can remove the connection information.

To remove a connection to a remote site

  1. From the Connect to list, select the connection that you want to remove.

  2. Click the Disconnect from currently selected remote site button.

Copying Files Individually

To copy files individually

  1. Select the file or files that you want to copy.

  2. Click the copy button between the Source Web Site and Remote Web Site lists, using the button that indicates what direction you want to copy. To copy the recent version of a file to the site with the older version, select the synchronize button.

    The status pane at the bottom of the window displays the results of the copy operation.

    Note

    Files that have not changed are not copied.

Copying All Files at Once

To copy all files at once

  1. From the Move files drop-down list, select All source web files to remote Web site or All remote Web files to source Web site.

  2. Click Copy Web Site.

    All files are copied, overwriting existing files, with the following exceptions:

    • An older version of a file is never copied over a newer version. Because of this, the two sites might not be identical, even after copying the entire site.

    • If the files being copied include a deleted file and the target still has a copy of the file, you are prompted to indicate whether you want to delete the file in the target site as well.

    • If the files being copied are changed in the target site, you are prompted to indicate whether you want to overwrite the file in the target site.

Synchronizing Files

If you want to be sure that both sites have identical copies of all files, you can synchronize sites.

To synchronize sites

  1. From the Move files drop-down list, select Synchronize source and remote web sites.

  2. Click Copy Web Site.

    The Copy Web Site tool checks the status of each file and performs the following tasks:

    • New files are copied to the site that does not have the file.

    • Changed files are copied so that both sites have a copy of the newest version of the file.

    • Unchanged files are not copied.

    Synchronization can detect situations that require you to indicate how it should proceed. The following table summarizes these conditions.

    Condition

    Result

    File has been deleted on a site.

    Prompts you to indicate whether you want to delete the corresponding file in the other site.

    A file has different timestamps on both sites. (The file has been added or edited at different times in both sites.)

    Prompts you to indicate which version of the file you want to keep.

See Also

Tasks

Walkthrough: Copying a Web Site Using the Copy Web Site Tool

Concepts

Copying Web Sites with the Copy Web Site Tool

ASP.NET Deployment Overview