2016-09-24 178 views
4

我有!用digikam管理的价值十年的标签照片和我的debian稳定/测试组合最近升级至digikam 5. *。(mysql)数据库迁移难度从digikam 4. *迁移到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

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

荷兰Joh

回答

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已经发布两天了!

+0

谢谢你指出这一点。在我的情况下,您的查询结果如下: 'select * from ImageInformation imageid not in(从图像中选择id);#18 rows' 'select * from ImageMetadata imageid not in(从图像中选择id);#18 rows' 'select * from ImageComments where imageid not in(select id from Images);#21 rows' 'select * from标签其中pid!= 0且pid不在(从标签中选择id); #1 row' 'select * from ImageTags where tagid not in(从标签中选择id);#8 rows' 'select * from ImageTags where imageid not in(从图像中选择id);#111 rows'。我是否删除这些行? – balin

+0

对于“爱的十年”,它似乎只是一小部分的损失,所以我只是删除它。当然,我认为你有一个非常安全的地方你的数据库的当前状态备份... 我也看看附件https://bugs.kde.org/attachment.cgi?id=99906和错误报告的https://bugs.kde.org/attachment.cgi?id=99907 - 在更新尝试和手动更新脚本之前修复数据库。 – Jockel

+0

重新读取您的评论并删除除代码生成的具有根标记的行之外的所有行,并且逐步完成Bug提供的模式v.7到v.8升级代码解决了我的问题。非常感谢你。 – balin

2

(有一个很难从Debian的喘息迁移到Debian的拉伸,希望这可以帮助别人...)

这为我工作:

  • 确保的digiKam没有运行

  • 将您的旧配置文件从~/.kde/share/config/digikamrc复制到~/.config/digikamrc

  • 打开您的带有一些sqlite编辑器的数据库文件(例如digikam4.dbsqlitebrowser

  • 编辑表AlbumRoots和固定在斜线标识符(即更换/%2F所有实例)

    UPDATE AlbumRoots 
    SET identifier = replace(identifier, '%2F', '/') 
    WHERE identifier LIKE '%%%2F%'; 
    
  • 保存数据库

  • 交叉手指(可选,但推荐)

  • 开始的digiKam

祝你好运!

+0

它非常有帮助,谢谢! – palacsint