diff --git a/README.md b/README.md index a2fafad..9f03fa6 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ First get kanboard-sqlite2mysql: git clone https://github.com/oliviermaridat/kanboard-sqlite2mysql cd kanboard-sqlite2mysql - chmod u+x kanbord-sqlite2mysql.sh - chmod u+x kanbord-backup.sh + chmod u+x kanboard-sqlite2mysql.sh + chmod u+x kanboard-backup.sh Then backup your Kanboard data: @@ -32,11 +32,11 @@ Then backup your Kanboard data: And finally create the SQL dump file compatible with MySQL: - ./kanbord-sqlite2mysql.sh -o db-mysql.sql + ./kanboard-sqlite2mysql.sh -o db-mysql.sql Or you can also directly apply it to the MySQL database of your choice: - ./kanbord-sqlite2mysql.sh [ -h -u -p ] + ./kanboard-sqlite2mysql.sh [ -h -u -p ] Running this script may take 2 or 3 minutes. diff --git a/kanboard-sqlite2mysql.sh b/kanboard-sqlite2mysql.sh index 1592c20..4514e30 100755 --- a/kanboard-sqlite2mysql.sh +++ b/kanboard-sqlite2mysql.sh @@ -188,6 +188,8 @@ createMysqlDump() TRUNCATE TABLE plugin_schema_versions; SET FOREIGN_KEY_CHECKS = 1;' > ${OUTPUT_FILE} + echo 'ALTER TABLE `tasks` CHANGE `column_id` `column_id` INT( 11 ) NULL;' >> ${OUTPUT_FILE} + sqlite_dump_data ${sqliteDbFile} >> ${OUTPUT_FILE} echo 'ALTER TABLE users DROP COLUMN is_admin; @@ -198,6 +200,8 @@ createMysqlDump() ALTER TABLE project_has_users DROP COLUMN id; ALTER TABLE project_has_users DROP COLUMN is_owner;' >> ${OUTPUT_FILE} + echo 'ALTER TABLE `tasks` CHANGE `column_id` `column_id` INT( 11 ) NOT NULL;' >> ${OUTPUT_FILE} + # For MySQL, we need to double the anti-slash (\\ instead of \) # But we need to take care of Windows URL (e.g. C:\test\) in the JSON of project_activities (e.g. C:\test\" shall not become C:\\test\\" this will break the json...). Windows URL are transformed into Linux URL for this reason cat ${OUTPUT_FILE} \