1、安装sqlite3
apt install sqlite3 -y
2、导入数据库
6a7dab0593f81.db是新的数据库名称
old.db是含有数据的数据库名称
sqlite3 6a7dab0593f81.db "ATTACH 'old.db' AS old_db; INSERT INTO typecho_contents (cid, title, slug, created, modified, text, \"order\", authorId, template, type, status, password, commentsNum, allowComment, allowPing, allowFeed, parent) SELECT cid, title, slug, created, modified, text, \"order\", authorId, template, type, status, password, commentsNum, allowComment, allowPing, allowFeed, parent FROM old_db.typecho_contents WHERE cid NOT IN (SELECT cid FROM typecho_contents); DETACH old_db;"
3、较验CID
sqlite3 6a7dab0593f81.db "UPDATE sqlite_sequence SET seq = (SELECT MAX(cid) FROM typecho_contents) WHERE name = 'typecho_contents';"
4、权限设置
chown 1000:1000 6a7dab0593f81.db