The script mentioned in Robert's post works well,(Thanks much!!) but it looks for a table called BackingPhotoTable which does not always exist (maybe created after photos are modified?) If it does not, the export script will fail.
This will create the table and solve the problem.
CREATE TABLE IF NOT EXISTS BackingPhotoTable (id INTEGER PRIMARY KEY, filepath TEXT UNIQUE NOT NULL, timestamp INTEGER, filesize INTEGER, width INTEGER, height INTEGER, original_orientation INTEGER, file_format INTEGER, time_created INTEGER)
The default path for the photo.db does not seem work, but specifying it in a parameter does.