How the synchronization in Windows 7 Offline Files works

How the synchronization in Windows 7 Offline Files works

  • Comments 71
  • Likes

Hello,

In this article i will present the way offline files synchronize and focus on Windows 7 enhancements.

To understand synchronization we have to understand the concepts of “auto-caching” and “sparsely-cached” files:

- Auto-cached files are those files that are cached automatically when opened on a server configured to support “automatic caching”. Initially, only those blocks of data read by the client application are cached, producing a “sparse” file in the cache.

- Sparsely-cached files are available to the client only when the associated network share is connected (a.k.a. “online”). In order to make a sparse file available while offline, it must first be “filled” while online. Filling of a sparse file ensures the complete file is in the cache. Most sparse files are automatically filled in the background by the “CSC Agent” so sparse files are rarely an issue. However, since sparse files are unavailable while offline, it is necessary that they be filled prior to disconnecting from the network.

Optimized file synchronization:

One of the performance enhancements of Offline Files in Windows Vista is a faster synchronization process. This is achieved by using a new synchronization algorithm that does the following:

- reduces the time and bandwidth needed to identify differences between the local cache and the server

- determines which parts of a file in the local cache have changed, and then updates only those parts of the file on the network server

The process of updating only parts of a file on the server is called Bitmap Differential Transfer. It takes place during synchronization of the local cache to the server.

Bitmap Differential Transfer

- Offline Files in Windows Vista and Windows 7 uses Bitmap Differential Transfer. Bitmap Differential Transfer tracks which blocks of a file in the local cache are modified while you are working offline and then sends only those blocks to the server. In Windows XP, Offline Files copies the entire file from the local cache to the server, even if only a small part of the file was modified while offline.

Because Bitmap Differential Transfer can make the synchronization more efficient, Offline Files in Windows Vista and Windows 7 supports all file types. Offline Files in Windows XP could not synchronize large files efficiently; therefore, certain types of files were specifically excluded from the local cache.

- Bitmap Differential Transfer is not used when synchronizing changes from the server to the local cache. If a file is modified on the server when you are offline, Offline Files in Windows Vista or Windows 7 will copy the whole file to your local cache during synchronization. Bitmap Differential Transfer works only for pre-existing files and not for files that were created while working offline. Because of this limitation, files modified with applications that do not modify the file in place will not work with Bitmap Differential Transfer. For example, Microsoft® Word creates a temporary file that is used to replace the original file. These types of files are considered new, and they are copied in their entirety from the local cache to the server.

The "Synchronize all offline files before logging off " and "synchronize all offline files when logging on" are no longer available for Windows Vista and Windows 7 : http://technet.microsoft.com/en-us/library/cc749449(WS.10).aspx#BKMK_Optimized . The main reason is the client has cached the file when it has accessed to this file in read mode. Then only the difference (block of data that has changed for a file) is synchronized on a regular bases or when logon (background), logoff and Slow Link change.

What are the settings in Windows 7:

There are some settings with which you can play to ensure client are correctly synchronized before they leave the network (shutdown or logoff) :

- Configure Background Sync : this policy applies only for Windows 7and Windows Server 2008 R2 (offlinefiles.admx)

This is a machine-specific setting which applies to any user who logs onto the specified machine while this policy is in effect. This policy is in effect when a network folder is determined, as specified by the "Configure slow-link mode" policy, to be in "slow-link" mode.

For network folders in "slow-link" mode, a sync will be initiated in the background on a regular basis, according to these settings, to synchronize the files in those shares/folders between the client and server.

By default, network folders in the "slow-link" mode will be synchronized with the server every 360 minutes with the start of the sync varying between 0 and 60 additional minutes. You can override the default sync interval and variance by setting 'Sync Interval' and 'Sync Variance' values. You can also set a period of time where background sync is disabled by setting 'Blockout Start Time' and 'Blockout Duration'. To ensure that all the network folders on the machine are synchronized with the server on a regular basis, you may also set the 'Maximum Allowed Time Without A Sync'. You may also configure Background Sync for network shares that are in user selected "Work Offline" mode. This mode is in effect when a user selects the "Work Offline" button for a specific share. When selected, all configured settings will apply to shares in user selected "Work Offline" mode as well. If you disable this setting or do not configure it, the default behavior for Background Sync will apply.

This would be a short explanation on how the offline files sync works. If you have any questions, please use the comments section to ask them.

--- Jonny

Comments
  • Hello...

    Thanks for the article. I am trying to wrap my head around about the offline file synching process in Windows 7 as there is a lot of confusion with this in our org.

    Assuming all default settings, it appears a full sync is performed when a user logs in. From that point on any files updated by the user will be saved to both the local cache and the file server (correct?).

    But what about other files that other users may modify? I don't see another full sync occurring at all. If User A modifies a file on a share, when will this file be synced for User B? How often is a full sync performed? Only at logon unless I set a schedule?

    Thanks

  • Hello

    full sync is only at login, or when you schedule it. The same for User B. But your description sounds like that User A & B are using the same share in offline files Feature!? I dont recommend this. better to have a own share for each user. If you want to share the same Documents for every User, then you should use Microsoft Sharepoint.

    hth/brgds

    Jonny

  • Thanks for the write-up, Jonny.  I've got a related question.  How would I go about setting a policy that would force synchronization on a schedule (every 5 minutes) for all laptops on a domain?  Is that possible?

    Thanks.

  • Apologies:  Would be policy on a Vista/Windows 7 domain.

  • Can you explain the concept of Temporary Offline Files vs Offline Files ?

    Not sure to fully understand the use of this functionnality.

  • @JM

    use the GPO: "Configure Background Sync : this policy applies only for Windows 7and Windows Server 2008 R2 "

  • @Seb

    technet.microsoft.com/.../cc749449(WS.10).aspx

    Caching

    When you create a shared folder on a server, there are three caching options available for that folder:

    Manual caching (default). If you want a file in the shared folder to be available on your computer when you are offline, you must manually select it to be made available offline.

    Automatic caching. When this option is selected, every time you access a file in a shared folder, the file will be made temporarily available on your computer offline.

    No caching. Files in the shared folder cannot be made available offline.

    Specific files can also be selected to be cached automatically by using the Administratively assigned offline files Group Policy setting.

    when you use offline files, they are available when you are not connected to the share, for example at home with no corp net access.

    temporary offline files are the files which are temporarely cached while working with corp net access, that saves bandwith and increases the perfomance when accessing the File a second time, because it is in your cache. When you go offline,  for example at home with no corp net access, these files are not offline available.

  • hello,

    i have some problem with synchronize in windows 7, prior to  windows 7 this problem is never exist,

    i used folder redirection to NAS for document desktop and profiles for all users, and we use a mobile concept here, so one computer isnt belong to one user,

    sometimes the files not synchronized at all, i notice that there are a conflict appears in sync center, so the user need to login on the last computer where they modified the files first, and then they need to resolve the conflict and the synchronize will be ok,

    i think this is happened because the files is saved in local cache and not sync with the NAS, i assume this because see in my backup system (Symantec Exec 2010), somefiles that backed up isn't up-to-date.

    this never happen on xp, because the sync always occur when logging on/off

    i think this can be solved by background sync, could you give me a recommended setting for this

    fyi : DC : server 2008, NAS : storage 2003

    and sorry for my bad english

    thanks

  • Have a question regarding log on sync.. does it do a full sync? or just quick sync like windows xp?

  • Hello inspirion12,

    we do a full sync, you can avoid this by configuring the GPO:

    Policy: Turn on economical application of administratively assigned Offline Files

    Category Path: Computer Configuration\Administrative Templates\Network\Offline Files\

    Supported On: At least Microsoft Windows Vista

    This policy setting allows you to turn on economical application of administratively assigned Offline Files.

    If you enable this policy setting, only new files and folders in administratively assigned folders are synchronized at logon. Files and folders that are already available offline are skipped and are synchronized later.

    If you disable or do not configure this policy setting, all administratively assigned folders are synchronized at logon.

    hth

    Jonny

  • Hi DMZ,

    you can set up the synch as descibed in this Blog:

    blogs.technet.com/.../how-to-schedule-synchronizations-in-windows-7.aspx

    Or via GPO: Configure Background Sync : this policy applies only for Windows 7 and Windows Server 2008 R2

    How to is described in the Policy

    you should check the Conflicts and check why they occure, also check if the NAS is W7 compatible!

    HTH

    Jonny

  • i've already checked the comment for the conflict, it said "a file was change in this computer and the server when this computer was offline", referring that statement, i want to redirection user's document folder without offline files feature.

    i just set new folder redirection policy with disable rules for : "prevent use of oflline files", "remove make available offline", "prohibit user configuration of offline files", and "action on server disconnect" is set to "never go offline"

    with policies above i want to make a folder redirection act like a normal mapped network drive, but there are still conflicts for the users who use this policy, or i need to set in slow-link mode too?

    thanks,

    br

  • Hi,

    I am also experiencing the exact same problem as dmz. We use a NAS (Storevault S550) as our file store (using CIFS) and folder redirection in Windows 7 for peoples Documents folder. We often get files that don't sync, especially when people use different computers.

    Are there any solutions? The policys above apply to 'slow link mode' yet our NAS is not on a slow link, it's on our LAN. Should i configure it for this anyway?

    Thanks,

    James

  • Hi dmz,

    I recomend to install support.microsoft.com on the W7 Clients.

    The GPO "action on server disconnect" does not aply on Windows 7. You dont need to set the slow link mode, Windows 7 does the transition to slow link by default with a Latency of 80 ms. Maybe a Cache resett helps once you configured everything. Cache3 reset is described here: support.microsoft.com/.../942974

  • Hi James,

    on Folder Redirection the Offline Files GPO's do not apply. From the Offline Files Point of view I cannot help you. Maybe you want to check the Event Logs for FR Events and maybe the Cache Reset and the mentioned KB (see comment for dmz) helps for you to? Check if the FR Policy did apply by using the command gpresult /H .

    Folder Redirection is a different Feature which is only using the Offline Files Cache to store the Data.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment