SQLite to MySQL script goes wrong

Hi everyone
After run the “sqlite2mysql.sh” script to migrate sqlite to mysql, the script published here (Migrate From SQLite to MySQL - Seafile admin manual), I get some incorrect sql statements:

output of the “seahub_db.sql” file

`DROP TABLE IF EXISTS `IF`;

CREATE TABLE IF NOT EXISTS `IF` NOT EXISTS `django_migrations` (`id` integer NOT NULL PRIMARY KEY AUTO_INCREMENT AUTO_INCREMENT, `app` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `applied` datetime NOT NULL) ENGINE=INNODB;
INSERT INTO `django_migrations` VALUES(1,'admin_log','0001_initial','2017-09-25 05:15:11.274464');

DROP TABLE IF EXISTS `IF`;
CREATE TABLE IF NOT EXISTS `IF` NOT EXISTS `registration_registrationprofile` (`id` integer NOT NULL PRIMARY KEY AUTO_INCREMENT AUTO_INCREMENT, `emailuser_id` integer NOT NULL, `activation_key` varchar(40) NOT NULL) ENGINE=INNODB;

DROP TABLE IF EXISTS `IF`;
CREATE TABLE IF NOT EXISTS `IF` NOT EXISTS `api2_token` (`key` varchar(40) NOT NULL PRIMARY KEY, `user` varchar(255) NOT NULL UNIQUE, `created` datetime NOT NULL) ENGINE=INNODB;

INSERT INTO `api2_token` VALUES('ebe5cb6763************************a9a2','asdasdasd@posteo.ch','2020-05-08 07:46:57.069152');`

How can I fix this?

Hi all

any suggestions, more information, ambiguities …

it is not possible to migrate my seafile and it can not be used currently

Which version of Seafile are you using?

I’ve upgraded from version 7.x to 8.x. Now its 8.0.3 for Raspberry Pi

Hello, I think the problem is caused by such sql statement.

Can you have a check why this sentence IF NOT EXISTS is repeated on Raspberry Pi?

Hi, I dont know why this happen. I run the “sqlite2mysql.sh” script and what I get as a result is just what I wrote above.

But the topic is now a month old, so I can not migrate my system and will find a way to export my data and look for another service.

Sorry for the late reply, as you are using Raspberry Pi, we don’t have such test environment to reproduce this problem.

You can try to manually change the sql statement to make them conform to sql syntax.

i wanted to do that too, but every statement is wrong. not only the one mentioned here. the effort is too big.

I am also having this problem with seahub_db.sql.
Server is Ubuntu 18.04LTE
All of the drop-/create table commands have a duplicated IF NOT EXISTS section