If you're a road warrior, you're familiar with the need to sync your laptop when you get back to the home office. This excerpt from Bott, Siechert, & Stinson's Windows 7 Inside Out will help you get familiar with syncing between two Windows 7 systems.
The trouble with shared network files and folders is that they're not always there when you need them. The situation is especially awkward with portable computers, which are designed to be disconnected from wired networks and carried out of range of wireless access points. If you're working with a group of files on a server at the office, how do you keep working when you no longer have access to the network?
Several solutions are available. If you are using the Professional or Ultimate/Enterprise edition of Windows 7, you can mark folders or files on any network share as Always Available Offline. Those files will then be available for use whether or not you are connected to the network, and Windows 7 will transparently keep everything in sync.
If your edition of Windows 7 does not support offline files, you can keep your work life synchronized by using either Windows Live Mesh or Windows Live Sync. These free web-based tools are particularly useful for collaborative projects in which multiple, perhaps widely dispersed, users contribute input to common shared folders.
The offline files feature lets users of Windows 7 Professional, Ultimate, or Enterprise "pin" files stored on network shares, making those files available on their own computers, whether or not the network is online. When you mark a folder or file as always available offline, Windows copies that item to a cache on your own computer. When you take your computer offline, you can go on working with the cached items as though you were still connected to the network. When you reconnect, Windows automatically synchronizes the cached items with their network counterparts.
The offline files feature is useful even if you never intentionally disconnect from the network. If the network goes down (or simply slows down significantly), Windows begins using cached items instead of their server-based counterparts; when the connection is restored or the logjam breaks, your files are synchronized. You can also simply opt to work with cached files instead of network-based files even when the network is online.
Synchronization of offline files normally occurs whenever you reconnect to the network—or, if you choose to work offline while you're connected to the network, whenever you return to online status. Background synchronization, by default, occurs approximately every six hours while you are connected. You can also perform ad hoc synchronization, synchronize on a schedule of your choosing, or set up an event-driven synchronization schedule—for example, stipulate that Windows should synchronize whenever you lock or unlock your Windows account. The option to synchronize on demand is particularly important; to ensure that your offline cache holds the latest versions of any files you intend to use when you go offsite, you should perform an ad hoc synchronization right before you disconnect.
Files cached for offline access are indexed by default, so you can search for them the same way you would any other indexed file.
To make a folder or file available offline, navigate to its network location, right-click, and choose Always Available Offline:
As soon as you choose this command, Windows begins copying the selected item to your local cache. You will see a progress report while this is occurring. On completion, you will see a report of success or failure. In the following example, two errors have occurred:
Two of the files on the server were in use and therefore couldn't be synchronized. In this circumstance, you could close the server copies (if you're the one using them) and perform a manual sync. Or if you don't need the offline copies right away, you could let the next scheduled background synchronization take care of the problem.
After you have made files available offline, certain changes in Windows Explorer allow you to confirm their new status (see Figure 10.4):
Folders available offline are marked with a green icon, similar to the Sync Center icon in the notification area.
The same green icon appears in the Windows Explorer details pane, along with the words Always Available.
On the right-click context menu, a check mark appears beside the Always Available Offline command and a new Sync command appears below it.
A Sync command appears on the toolbar.
The Properties dialog box for any file or folder in the offline cache also changes, acquiring a new Offline Files tab, complete with a Sync Now button:
As mentioned, before disconnecting from the network (or clicking Work Offline on the Windows Explorer toolbar), you should always synchronize any folders or files you intend to use offline. Windows will not do this for you, and if a file is not up to date when you try to use it offline, Windows will deny you access. You can perform this synchronization in a variety of ways. The simplest is to right-click any folders containing files you want to work with, choose Sync from the shortcut menu, and then choose Sync Selected Offline Files. Alternatively, you can open Sync Center in Control Panel, select View Sync Partnerships, right-click Offline Files, and then choose Sync Offline Files. (On a portable computer, you can get to Sync Center by pressing Windows logo key+X to open the Windows Mobility Center; click the green icon to open Sync Center, or click the Sync button to sync all.)
There are several ways to get to your cached files while you're working offline. If you create a shortcut to any network folders you intend to use offline, you can open the cached folder offline by clicking its shortcut. If you map the network share to a drive letter, your offline files will be accessible via that drive letter. Alternatively, you can open Sync Center, click View Sync Partnerships, click Offline Files, click the share you want to use, and then click Browse on the toolbar:
If you have changed the file while offline and the server-based copy has not been changed, Windows updates the server copy with your changes.
If you have not made changes to your offline copy but the server copy has been changed, Windows updates the copy in your cache.
If either the offline copy or the server copy of a file is deleted, the file on the other computer is deleted as well, unless the file on the remote computer was changed while you were offline.
If one copy has been deleted and the other copy has been changed, Sync Center displays a dialog box that allows you to delete the versions in both locations or copy the changed version to both locations.
If a new file has been added on the server to a folder that you have marked for offline availability, that new file is copied to your cache.
If both the server copy and your offline copy have changed, Sync Center records a sync conflict. You will have the opportunity to resolve the conflict, but typically the only way you know a conflict exists is by observing a change to the Sync Center icon in the notification area. A yellow caution marker adorns the conflicted icon:
Click this icon to open Sync Center, and then click View Sync Conflicts. Sync Center will display the names of any files that have changed in both the server and cache locations:
Click the name of a file to resolve the conflict. As Figure 10.5 shows, you can keep either version or both, and the dialog box gives you some information about which file is newer and which is larger. If you know which one you want to keep, click it. If you want to inspect a version before deciding, right-click it and choose Open.
Figure 10.5. When synchronization reveals file conflicts between the server and cache, you can choose which version to keep—or save both versions and sort out the differences later.
Windows synchronizes offline files, by default, about once every six hours. To set up additional regular synchronization points, open Sync Center, click View Sync Partnerships, click Offline Files, and then click Schedule on the toolbar. You'll see a list of items that you can schedule, shown next.
Make your selections and click Next. On the following screens, you can choose to sync at a scheduled time or on particular events.
Click At A Scheduled Time to set up a recurring schedule. In the Repeat Every setting, choose minutes, hours, days, weeks, or months; for folders where frequent updates are essential, you can specify that sync operations should occur every n minutes or hours.
Regardless of which scheduling route you take, the More Options button leads to the dialog box shown in Figure 10.6, which allows you to favor power management by allowing sync cycles only when you're running on external power and pausing the schedule if the PC is asleep or hibernating.
Figure 10.6. The default settings for a sync schedule prevent the Offline Files service from waking up a sleeping computer to sync files.
If the files you take offline include private information, you might want to encrypt them. The cached copies will then be hidden from all accounts but your own. To encrypt your offline files, follow these steps:
Note that encrypting offline files affects the cached copies only, and that once you have exercised the encryption option, all subsequent additions to the cache will also be encrypted.
Our discussion of the behavior of offline files and folders so far in this chapter has assumed that the caching property of each network share accessed for offline work is set at its default value. This value, called Offline Settings, is one of three possible settings. To adjust the caching property, do the following on the server computer:
In the console tree (the left pane), select Shares.
In the details pane (the right pane), double-click the share whose property you want to set (or right-click and then choose Properties).
On the General tab of the properties dialog box, click Offline Settings. The Offline Settings dialog box opens, as shown in Figure 10.7.
If you prefer, you can access the Offline Settings dialog box directly from a shared folder. Right-click the folder icon and choose Properties. On the Sharing tab, click Advanced Sharing, and then click Caching in the Advanced Sharing dialog box.
The default setting, Only The Files And Programs That Users Specify Are Available Offline, stipulates that a computer connecting to the shared folder from across the network will cache only those files and folders that the user has explicitly marked as Always Available Offline.
The second option, No Files Or Programs From The Shared Folder Are Available Offline, completely disables caching of files from that share.
If you choose the third option, All Files And Programs That Users Open From The Share Are Automatically Available Offline, any file opened from a remote computer will be automatically cached for offline use. When you open a cached document from a client computer, the cached copy is used, but the original document on the server is also opened to prevent other people from changing the file while you have it open. This setting is more convenient and easier to use than the default manual caching. On the other hand, with automatic caching, Windows doesn't guarantee that your server resources remain in the cache. How long they stay there, in fact, depends on usage. As the amount of disk space you've allocated to the cache is consumed, Windows discards any documents that have not been used recently to make room for newer ones.
Because careless caching of large network shares could overwhelm the storage capacities of a mobile computer, Windows by default limits the size of the offline cache to something under 25 percent of the client computer's disk space. (The cache is stored, by default, in hidden system folders under %SystemRoot%\CSC. For information about relocating the cache, see Microsoft Knowledge Base article 937475, at w7io.com/1002.)
To see how much cache space you're using and how much is still available, open Control Panel, type offline files in the search box, and click Manage Offline Files. The Disk Usage tab of the Offline Files dialog box provides the statistics:
Note that the Temporary Files portion of this report is relevant only if you are using the All Files And Programs That Users Open From The Share Are Automatically Available Offline option, described in the previous section (see Figure 10.7). Windows will delete files from the temporary cache when necessary, but you can do the job yourself by clicking Delete Temporary Files. To increase or decrease the amount of space available for offline files, click Change Limits. The Offline Files Disk Usage Limits dialog box will appear:
Note that the second slider in this dialog box cannot be moved to the right of the first slider.
When you no longer need offline access to a network resource, open the sync item in Windows Explorer, right-click, and clear Always Available Offline. If the share involved is set for manual caching (the Only The Files And Programs That Users Specify Are Available Offline option described on the section called “Setting Caching Options on the Server”), Windows purges the items from your cache in addition to removing the offline access attribute. If the share is set for automatic caching, items that are currently in the temporary cache remain there. To delete those files, open the Offline Files option in Control Panel. On the Disk Usage tab, click Delete Temporary Files. Note, however, that this option does not affect files you have marked to be Always Available Offline.
To eliminate all items from the Offline Files cache so that you can start over, you'll need to make a small edit to the registry. Before taking this drastic step, make sure you synchronize all sync items that contain changes you made that haven't yet been copied to the server location. The following steps completely erase all files from your Offline Files cache:
Using an administrator's account, open Registry Editor (Regedit.exe) and navigate to HKLM\System\CurrentControlSet\Services\CSC\Parameters. (This key is not created until you use Offline Files for the first time.)
Right-click the Parameters key and click New, DWORD (32-Bit) Value.
For the name of the new value, type FormatDatabase. (Note there's no space in that name.)
Double-click the new DWORD value and assign it a value of 1.
Restart your computer.
Live Mesh is an ambitious sharing and synchronization platform available free to users of any version of Windows 7, Windows Vista, Windows XP (with Service Pack 2 or later), or Mac OS X version 10.5 (Leopard) or later. With Live Mesh you can
Access devices in your mesh remotely.
Although Live Mesh was still in a public beta testing as this book went to press, we found it stable and usable. Future developments around Live Mesh will presumably enable you to incorporate additional types of devices into the mesh, along with third-party services.
To get started, go to www.mesh.com. Click Sign In and enter your Windows Live ID. If you're setting up a new mesh (as opposed to joining one that has already been established), you'll see a ring of potential devices and a big orange Add Device button:
To join the mesh, click Add Device. Select your operating system from the drop-down list that appears, and then click Install. When prompted, enter your Live ID (again). On completion of the installation process, you'll be asked to enter the name of your device as you want it to appear in the mesh. The software will propose your computer name for this purpose, but you can change that if you want. Finally, your device will appear in the mesh, replacing the phantoms (Your PC, Your Mac, Your Mobile) that were there before.
To add another computer to the mesh, repeat these steps at that computer.
A similar command appears for individual files. After you choose to add a folder or file, a dialog box lets you supply the name under which it will appear in the mesh, as well as the manner in which it is to be synchronized with Live Desktop and with each member device:
If you opt to synchronize with other devices as well as with your Live Desktop, changes you make to the file or folder will be propagated to each device and changes your collaborators make will be propagated to you.
Among other things, the icons and commands in the mesh bar let you inspect and modify synchronization settings and view a news feed of changes that have been made to the synchronized folder, as shown next.
To access your Live Mesh folders from any computer, navigate to www.mesh.com, sign in with your Live ID, and click Connect. To access a computer in the mesh and operate that computer remotely, navigate to the mesh, click Devices in the menu at the top of the window, and then click the name of a computer. The mesh ring will rotate to bring the selected device to the front, and clicking Connect will put you in control. (The computer itself will be locked to local users, and you will need to enter appropriate credentials to gain access.)
Windows Live Sync, formerly known as Foldershare, allows you to synchronize and share up to 20 folders. You can create personal folders for synchronization, accessible only to computers logged on with your own Windows Live ID, as well as shared folders for synchronization, accessible to whomever you permit. Folders can contain as many as 20,000 files each, with an individual file-size limit of 4 GB. With Live Sync, you can also browse remote computers logged on with your Live ID. (You cannot, however, operate such computers remotely, as you can with Live Mesh.)
To get started with Live Sync, you need to visit sync.live.com and download the Live Sync software. (Versions of the software are available for Windows and Macintosh.) Repeat these steps on each computer that you want to synchronize with.
With the software in place, a visit to sync.live.com will let you see which folders you have set up for synchronization, as well as the names of all computers that have logged on with your Live ID (see Figure 10.8). You can create a personal sync folder or a shared sync folder by clicking the appropriate command at the top of the window. With either command, the software responds by asking you to select a computer from the list of available devices. To share the Chapter Notes folder that is stored on Figaro, for example, you would select Figaro and then navigate to that folder. After setting up a shared folder, the system prompts you to enter e-mail addresses of those with whom you want to share.
Figure 10.8. The Live Sync webpage shows which personal and shared folders you have established for synchronization, as well as the names of devices that have installed the Live Sync software and logged on with your Live ID.
Synchronization can be automatic (Live Sync synchronizes whenever it detects changes) or on demand. Live Sync lets you decide when you establish the sync folder, but you can always revisit the issue. To see what the current setting is for a folder, go to sync.live.com and click the folder name (see Figure 10.9).
To change the synchronization mode, click it.
However and whenever you synchronize, Live Sync presents an audit trail of its activity. To see what files have been added, changed, or deleted on a computer, right-click the Live Sync icon in the notification area and choose Activity.
To browse the file resources of a remote computer, go to sync.live.com, click the device name, and then choose Browse. Following these steps with Figaro in Figure 10.8, for example, might reveal the following:
You can open and save files from here, just as you would in the remote computer's Windows Explorer.
To keep web favorites in sync on any computer where you access the internet, you don't need offline files, Live Mesh, or Live Sync. All you need is the Windows Live toolbar and, of course, your Live ID. (You can download the toolbar as part of the Windows Live Essentials suite; see Chapter 7 for details.)
Click the gold star, click Sync in the ensuing dialog box, and you're set. Windows Live copies your favorite shortcuts into the Favorites folder of your SkyDrive, where, even if you are the most prolific of favorite creators, they will consume a completely negligible fragment of your allotted 25 GB.