从 SQLite 迁移到 MySQL 报错。


#1

从 SQLite 迁移到 MySQL 报错。
我是按照英文手册的方法迁移,在执行第一步就报错了,错误信息如下:
-rwxr-xr-x. 1 root root 3575 Jun 5 16:54 sqlite_to_mysql.sh
[root@linux-t1 artssf]# ./sqlite_to_mysql.sh
Start export ccnet data from user
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Start export ccnet data from group
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Done export ccnet data
Start export seafile data
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help
Error: unknown command or invalid arguments: “mode”. Enter “.help” for help

生成的sql文件是这样的:
[root@linux-t1 artssf]# cat ccnet_db_data.sql
SET FOREIGN_KEY_CHECKS=0;
SET FOREIGN_KEY_CHECKS=1;
SET FOREIGN_KEY_CHECKS=0;
SET FOREIGN_KEY_CHECKS=1;
[root@linux-t1 artssf]# cat seahub_db_data.sql
DELETE FROM django_content_type;
DELETE FROM django_migrations;
SET FOREIGN_KEY_CHECKS=0;
SET FOREIGN_KEY_CHECKS=1;
[root@linux-t1 artssf]# cat seafile_db_data.sql
SET FOREIGN_KEY_CHECKS=0;
SET FOREIGN_KEY_CHECKS=1;

这个环境是从windows 6.0.7 迁移到linux 6.0.7 在这个版本迁移Mysql报错,试着把Seafile升级到最新版本后再迁移也报错。


#2

https://manual-cn.seafile.com/deploy/migrate_from_sqlite_to_mysql.html 你参考中文的文档迁移一下吧,英文的这个文档貌似有点旧了


#3

中文的我也试过了,能生成sql文件,但是在导入mysql也会报错。
中文手册跟英文手册有个不一样的地方 ,就在MYSQL建立数据库时 中文是ccnet-db ,英文是ccnet_db

也不知道那里出现问题。


#4

把导入报错贴出来看下


#5

刚刚用中文的重做了一次,成功了。
我发现是这样的问题,成功那次是复制文档的命令,报错那次是我手打的命令。
手打的是单引号’seahub-db’,复制文档是反单引号seahub-db:joy:

反单引号在这里还显示不出来。