(mysql)从digikam 4. *迁移到5. *时的数据库迁移难度

问题描述 投票:4回答:2

我有 !用digikam和我的debian稳定/测试组合管理的十年标记照片最近升级为digikam 5. *。

我现在面临的问题是,在尝试升级到更新的数据库方案(v.8)时,持有爱的劳动的(mysql)数据库似乎会出现问题。

当启动digikam v5。*指向4。* - 使用的数据库后端时,我得到以下内容:

digikam.dbengine: Loading SQL code from config file "/usr/share/digikam/database/dbconfig.xml"
digikam.dbengine: Checking XML version ID => expected:  3  found:  3
digikam.coredb: Core database: running schema update
digikam.coredb: Core database: have a structure version  7
digikam.coredb: Core database: makeUpdates  7  to  8
digikam.dbengine: Failure executing query:
 ""
Error messages: "QMYSQL: Unable to execute query" "Can't DROP 'Albums_AlbumRoots'; check that column/key exists" 1091 2
Bound values:  ()
digikam.dbengine: Error while executing DBAction [ "UpdateSchemaFromV7ToV8" ] Statement [ "ALTER TABLE Albums\n                                        DROP FOREIGN KEY Albums_AlbumRoots;" ]
digikam.coredb: Core database: schema update to V 8 failed!
digikam.coredb: Core database: cannot process schema initialization

当明确尝试使用包含在5. *中的数据库迁移工具时,我最终会得到下图中显示的错误:enter image description here

任何人都可以帮助decyphering这里发生了什么,分别如何解决它?

荷兰Joh

mysql image-processing kde
2个回答
4
投票

由于我的旧数据库中存在一些不一致,我遇到了同样的问题。修复后(主要是删除一些死引用)进行升级。我似乎还有另一个问题,但可能与db无关。

这将显示您的问题(除了根标签外都应为空):

取自https://bugs.kde.org/show_bug.cgi?id=355831#c73

select * from Images where album not in (select Albums.id from Albums);
select id, icon from Albums where icon != 0 and icon not in (select id from Images);
select * from Albums where Albums.albumRoot not in (select AlbumRoots.id from AlbumRoots);
select * from ImageHaarMatrix where imageid not in (select id from Images);
select * from ImageInformation where imageid not in (select id from Images);
select * from ImageMetadata where imageid not in (select id from Images);
select * from VideoMetadata where imageid not in (select id from Images);
select * from ImagePositions where imageid not in (select id from Images);
select * from ImageComments where imageid not in (select id from Images);
select * from ImageCopyright where imageid not in (select id from Images);
select * from Tags where pid != 0 and pid not in (select id from Tags);
select id, icon from Tags where icon != 0 and icon not in (select id from Images);
select * from ImageTags where tagid not in (select id from Tags);
select * from ImageTags where imageid not in (select id from Images);
select * from ImageProperties where imageid not in (select id from Images);
select * from ImageHistory where imageid not in (select id from Images);
select * from ImageRelations where subject not in (select id from Images);
select * from ImageRelations where object not in (select id from Images);
select * from ImageTagProperties where imageid not in (select id from Images);
select * from TagProperties where tagid not in (select id from Tags);
select * from ImageTagProperties where tagid not in (select id from Tags);

还有一个修复脚本可以在源头找到。

而我刚才了解到,5.2.0已于两天前发布!


3
投票

(很难从Debian Wheezy迁移到Debian Stretch,希望这有助于某人...)

这对我有用:

  • 确保digiKam没有运行
  • 将旧的配置文件从~/.kde/share/config/digikamrc复制到~/.config/digikamrc
  • 用一些sqlite编辑器打开你的digikam4.db数据库文件(例如sqlitebrowser
  • 编辑表AlbumRoots并修复标识符列中的斜杠(即用%2F替换/的所有实例) UPDATE AlbumRoots SET identifier = replace(identifier, '%2F', '/') WHERE identifier LIKE '%%%2F%';
  • 保存数据库
  • 交叉你的手指(可选,但推荐)
  • 开始digiKam

祝好运!

© www.soinside.com 2019 - 2024. All rights reserved.