[Digikam-devel] [Bug 277242] After SQLite --> MySQL conversion, digikam reports error regarding DBThumbnailsVersion on start up.

Francesco Riosa francesco+kde at pnpitalia.it
Mon Jul 11 12:08:38 BST 2011


https://bugs.kde.org/show_bug.cgi?id=277242





--- Comment #11 from Francesco Riosa <francesco+kde pnpitalia it>  2011-07-11 11:08:37 ---
(In reply to comment #10)
> >
> >
> > I'll test using separate databases for images and thumbnails, in the
> > meantime
> > could you explain the rationale for using different databases in mysql for
> > tables and thumbs?

still todo but soon (TM) ;)

> >
> > Because I was thinking on this the last week and made no sense to me,
> > either it
> > should be possible to have different types of databases i.e. images on
> > mysql
> > and thumbs on sqlite, or it should be all in one database, so I'm curious
> > of
> > this one
> >
> 
> I like to keep thumbnails separate for the sole reason of slim backups.
> Explanation:
> I run a sql backup every week, and having 1.3GB as thumbnails, it is a bit
> heavy. The image DB has 130MB only (contains 56k images at the moment,
> interestingly, the bulk data is copyrights). So I don't do backups on
> thumbnails. Should I loose them, digikam will rebuild them in 2 hours.
> Digikam foresees the dual DB system in the settings: you can specify two
> schema names. And, by the way, when using sqlite it uses to DBs as well.
> 
> Gerhard

I do understund, but please permit me to suggest a script that does the dump of
the wanted data, and append only the structure of thumbnail database, it use
the the standard `mysqldump` program


TIMESTAMP=$( date -u +%Y-%m-%dT%H-%M-%S )
DIGIKAM_DATABASE=digikam
u=digikam
p=digikam

mysqldump \
  --opt --routines \
  -u"${u}" -p"${p}" \
  --ignore-table="${DIGIKAM_DATABASE}.Thumbnails" \
  --ignore-table="${DIGIKAM_DATABASE}.UniqueHashes" \
  --ignore-table="${DIGIKAM_DATABASE}.FilePaths" \
  --ignore-table="${DIGIKAM_DATABASE}.CustomIdentifiers" \
  ${DIGIKAM_DATABASE} \
  > digikam-${TIMESTAMP}

mysqldump \
  --opt \
  --no-data \
  -u"${u}" -p"${p}" \
  "${DIGIKAM_DATABASE}" \
    Thumbnails \
    UniqueHashes \
    FilePaths \
    CustomIdentifiers \
  >> digikam-${TIMESTAMP}

gzip digikam-${TIMESTAMP}

## restore with:
# gzcat digikam-${TIMESTAMP}.gz | mysql -u"${u}" -p"${p}" "${DIGIKAM_DATABASE}"

-- regards, Francesco

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list