Resync Existing Google Drive Folder After Reinstalling OS

Posted on August 31, 2013
"Experience is the name everyone gives to their mistakes. ~Oscar Wilde".

I'm not an exception here. I made a mistake with a Google Drive folder on my Windows system. And after resolving the issue I gave it a good title called "Experience". But this so called experience cost me 2+ GB waste of bandwidth and some electricity units. So, it's not always advisable to learn only from our mistakes. Below is the complete case of the Google Drive nightmare I had on my Windows system. Though the solution works also for Mac OS users.

Problem:


Google Drive resyncs everything after reinstalling Windows/Mac OS even if you have backed up your Google Drive folder before reinstalling Operating System. This exact mishap happened with me few months back. I backed up all my hard disk partitions and My Documents stuff in an external hard disk. In my case, I had kept the Google Drive folder in the D drive. So, it was also backed up automatically as I was copying full disk partitions.

I had an impression that Google Drive will be keeping all the syncing logic metadata files in the same folder but with hidden attributes. This was really foolish impression I had, that I realized later. I reinstalled Windows on my machine and installed Google Drive again. During the Google Drive setup process, I chose Advanced Setup option just to re-attach my existing Drive folder which I had backed up before. But to my surprise when I selected the existing folder, I got the following message.

Google Drive sync issue after reinstalling Windows or Mac OS

Alas! It clearly tells that I've to empty out my folder before start syncing. I was expecting that it will automagically sync all the existing files and folders within my existing Google Drive folder. But, I had very wrong impression of Google Drive's metadata files location which keeps logs of synced files and folders. I had nothing to blame but my laziness to know that exact location. I had to allow downloading all my 2+ GB data stored in Google Drive cloud to my computer. Imagine, if you have 100+ GBs of data stored in Google Drive and you encounter this issue. Real waste of time, bandwidth and electricity, isn't it?

Checkout some public social media posts who did same mistake, as I did.

Resolution:


This issue made me curious to find the location where Google Drive stores the metadata stuff. I quickly opened AppData (Windows 8 OS) folder which generally stores configuration data for various softwares installed on your system. And, I found there the Google Drive folder having all the metadata and logs of syncing history! If I had backed up that folder also, then I could definitely save myself from facing the issue.

I also Googled the issue to have exact solution and found the similar solution with a caveat that one has to quit Google Drive before backing up contents of the metadata directory and not to start until the reinstalling the operating system completes. Below are the exact steps you should perform before formatting your computer.
  1. Quit Google Drive service and don't start it again until you complete the installation process.
  2. Backup Google Drive folder.
  3. Backup Drive folder that contains metadata and sync logs. The path for this folder may varies based on different operating systems.

    Windows XP: %USERPROFILE%\Local Settings\Application Data\Google\Drive

    Windows Vista and later: %USERPROFILE%\AppData\Local\Google\Drive

    Mac OS: ~/Library/Application Support/Google/Drive
  4. [Updated 19 Mar, 2014 - From Marc's Suggestion in the Comments] - According to Marc, Backing up "HKEY_CURRENT_USER\Software\Google\Drive" Registry Key on Windows is advisable, if you are a Windows user.

    To backup the mentioned Registry Key:
    1. Open "Command Prompt" or "Run" box.
    2. Type "regedit" without quotation marks and hit enter.
    3. Navigate to the "HKEY_CURRENT_USER\Software\Google\Drive" registry key in the left pane.
    4. Right click on the "Drive" folder and export the key to your backup device/drive.
  5. Don't start Google Drive after formatting your computer and reinstalling Google Drive. At first, copy the metadata folder named as "Drive" that you backed up at the appropriate location based on your new operating system.

    For example, if you format your Windows XP based system to get latest Windows 8 OS then your location for Application Data folder would be "%USERPROFILE%\AppData\Local\Google\Drive" instead "%USERPROFILE%\Local Settings\Application Data\Google\Drive"
  6. [Updated 19 Mar, 2014 - From Marc's Suggestion in the Comments] - (Windows users only) Double click on exported registry key to restore it.

  7. Start Google Drive service. Choose Advanced Setup option and point the Google Drive location to your existing folder.
That's it. You are good to go now. Within a few minutes all your Drive data should be synced with Google Cloud.

I would request everyone to share this post as much as possible to save internet bandwidth as well as electricity energy which is still considered as scarce energy in many countries including India. Till the date in India, over 30 crore (300 million) people have no access to electricity. Of those who do, almost all find electricity supply intermittent and unreliable.

PS: For more detailed information and stats on Electrical energy in India download Electric Sector in India eBook created from Wikipedia.

Happy hassle free resyncing.