Jump to content


Photo

Backup blocked by SQLite tool doesn't have to be an issue

backup file in use sqlte

  • Please log in to reply
1 reply to this topic

#1 TomH

TomH

    Advanced Member

  • Members
  • PipPipPip
  • 6218 posts

Posted 21 February 2019 - 11:03 AM

I tried something recently that proved surprising and revealing. I've been caught out numerous times starting a RM backup when the database file was also 'open' in SQLiteSpy (and this observation may apply to others). RM throws an exception error that it cannot do the backup because the file is in use by another application and then gracelessly blocks you from doing anything more in RM. Then I have to close both RM and SQLiteSpy and start over! It's a real nuisance and I don't understand why it should happen when I know that no SQLite query is in progress and the database is static. And even if a read-only query is in progress, isn't the database still static and a read-only backup should be able to run concurrently. That may be a stretch, but...

 

I have discovered that Windows File Explorer lets me copy or zip a RM file that is open in both RootsMagic and SQLiteSpy.

  • Copying to the same folder auto-renames the file with " (copy)" appended to the name.
  • To zip the open .rmgc file, right-click on the .rmgc file and from the pop-up menu select Send to > Compressed (zipped) folder. It will have the same name as the database file but have the .zip extension.

Windows File Explorer can "Extract all" by default to a subfolder having the name of the database file, a nice safety feature if you want to avoid overwriting the current database. If you change the destination path so that it does overwrite the current database, it won't do so if it is open in either RM or SQLiteSpy but, unlike RM, File Explorer gracefully lets you carry on using it for other things.

 

Rename that zip file to the .rmgb extension and RM can restore from it (but SQLiteSpy must not have the current one open if overwriting it with the backup.

 

File Explorer can also backup your media folder (or any other files and folders selected in the FE window) concurrently with the database file. Or subsequently, by dragging and dropping them onto an already created  zip file. However, RM's restore from such a renamed zip file extracts only the .rmgc file. 

 

So, if Windows File Explorer is capable of zipping and making a copy of a database file that is open in SQLiteSpy or other inactive app, then so should RM. Yes?


Tom user of RM7550 FTM2017 Ancestry.ca FamilySearch.org FindMyPast.com
SQLite_Tools_For_Roots_Magic_in_PR_Celti wiki, exploiting the database in special ways >>> RMtrix-tiny.png app, a bundle of RootsMagic utilities.


#2 Jerry Bryan

Jerry Bryan

    Advanced Member

  • Members
  • PipPipPip
  • 3538 posts

Posted 21 February 2019 - 03:09 PM

So, if Windows File Explorer is capable of zipping and making a copy of a database file that is open in SQLiteSpy or other inactive app, then so should RM. Yes?

 

I have frequently wondered the same thing. My wild theory is that there must be something in RM's backup procedure that obtains some sort of "global exclusive lock" on the RM database that normal RM operations don't obtain, not even RM's normal update operations. It's a great mystery.

 

Jerry