Quickbooks Copy Over To Dropbox via Volume Shadow Copy Service

It’s a long title for a blog post that is very specific.

Here is the use case:

We want to backup our quickbooks file daily to Dropbox. The issue is that Quickbooks will lock the files while it is in use giving you sharing violations when trying to copy the files.

This means that in order to backup your quickbooks files you need to close down quickbooks and then run a backup. Annoying! Thankfully Windows XP and above have a service that is called Volume Shadowing. You can read all about it on the internet[s] :-D.

Previous *broken* solution

Just put all your Quickbook files straight into Dropbox… Bam! Your done, right!?  Well, it’s great if you only have one person accessing that Dropbox.  Let’s say you want someone across the country or, in our case, different countries accessing the files.  That person then has a share to the folder.

The problem comes if that other person either touches the files in anyway.  It could be through opening the files in Quickbooks, renaming, or anything.  If Dropbox sees a change it will do an upload of the files.

The problem is that at the original location, those files have been changing with new information.  Now the files end up getting overwritten and we have been finding that we can loose a days worth of information.

Eeeek! Bad news, right!  It’s nobody’s fault, it’s just that it’s hard to be careful not to change anything in Dropbox if you are on the side of the person that just wants to view the information not to write no data.

The final solution

  • Move Quickbook files out of the Dropbox folder.
  • Create a Windows task that runs daily.  The task will fire off a script (batch file).
  • The batch file mounts an additional drive that uses Volume Shadow Copy Service (also called Volume Snapshot Service or VSS)
  • The batch file copies the files through VSS that would have otherwise been inaccessible.
Details

There are many many ways to access the VSS and do this sort of thing.  I ended up coming across the following tools to help me out from this blog:

  • Volume Copy Simple Client – This just abstracts the built in volume shadow command line tool.
  • DosDev – Command line interface to the DefineDosDevice() and QueryDosDevice() API functions.  (In Windows 95/98/ME this utility is equivalent to the SUBST command.)
Now for the script…
I ended up with two scripts but I am sure you can put this together into one script:
QuickbooksCopyToDropbox.bat
This is called by the scheduler
1
2
3
@echo off

vscsc -exec=C:\\Scripts\QuickbooksCopyToDropboxRun.bat C:
QuickbooksCopyToDropboxRun.bat
1
2
3
4
5
6
7
8
9
10
11
12
rem DOS Volume Name to be assigned to the snapshot
set SNAPDOS=B:

rem The source folder and the destination folder
set DOCS_SRC=%SNAPDOS%\Users\\Documents\Quickbooks
set DOCS_DST=C:\Users\\Documents\Dropbox

dosdev %SNAPDOS% %1%\

xcopy %DOCS_SRC%\* %DOCS_DST%\* /Q /Y /R > %LOGFILE%

dosdev /D %SNAPDOS%
Done!

VirtualHost Forbidden on Windows 7 using XAMPP

Thought I would share a quick fix that was needed to have local subdomain when running XAMPP on Windows 7.

Go to C:\WINDOWS\system32\drivers\etc then locate ‘hosts’ file. NOTE: Create a backup of the file before editing.

Update it to include your virtual host:

127.0.0.1 localhost
127.0.0.1 dummy.localhost

Here is the reference I found:  http://www.codingcereal.com/2011/05/setting-up-multiple-subdomains-in-your-localhost-using-xampp/

Git and Notepad++

Simple but really helpful if you want to use Notepad++ as your default editor when using GIT. The location will depend upon your specific location. I happen to be on Windows 7 x64 bit.

1
2
[core]
    editor = \"/C/Program Files (x86)/Notepad++/notepad++.exe\" -m