|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
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.
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.
To connect to a remote site
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.
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.
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
From the Connect to list, select the connection that you want to remove.
Click the Disconnect from currently selected remote site button.
Copying Files Individually
To copy files individually
Select the file or files that you want to copy.
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.
Files that have not changed are not copied.
Copying All Files at Once
To copy all files at once
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.
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.
If you want to be sure that both sites have identical copies of all files, you can synchronize sites.
To synchronize sites
From the Move files drop-down list, select Synchronize source and remote web sites.
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.
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.