Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Successful Migration - Kanboard 1.2.19 #30

Open
mikeperalta1 opened this issue May 25, 2021 · 4 comments
Open

Successful Migration - Kanboard 1.2.19 #30

mikeperalta1 opened this issue May 25, 2021 · 4 comments
Labels

Comments

@mikeperalta1
Copy link

Thanks for this great tool !! :)

I've just successfully migrated a local Fedora 33 kanboard server and a CentOS8 vps kanboard server using the latest commit from this repo (f67cc78)

My Steps to success for each server:

  1. Make sure you have the right pdo/mysql drivers for your OS (omitted)

  2. Stop apache with sudo systemctl stop httpd to prevent requests messing with the database before you're done.

  3. Backup SQLite database somewhere

  4. Create MariaDB database with:

    • CREATE DATABASE kanboard CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  5. Create dedicated MariaDB user with appropriate permissions on the new database (omitted)

  6. Create the MySQL Dump: ./kanboard-sqlite2mysql.sh /path/to/kanboard

  7. Worry endlessly about the error message Error: near line 2: near ";": syntax error

  8. Edit the dumped sql file to include the three lines for encoding at the top:

    • SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;
    • SET CHARACTER SET 'utf8mb4';
    • SET SESSION collation_connection = 'utf8mb4_general_ci';
  9. Edit /path/to/kanboard/config.php to use the mysql database driver, and set your database details

  10. Use kanboard's common.php script to create an empty database with the command:

    • php /path/to/kanboard/app/common.php
  11. Enter the MariaDB shell (I'm lazy so I just did sudo mysql)

  12. Select the new database with:

    • USE kanboard;
  13. Import the dumped file with:

    • source /path/to/db-mysql.sql
  14. Move the old sqlite file somewhere just to be sure

  15. Start apache again with sudo systemctl start httpd

  16. Joy

Thanks again!

@mikeperalta1
Copy link
Author

One small issue so far: All newlines in task descriptions are now literal "\n"

@mikeperalta1
Copy link
Author

Hyperlinks inside task descriptions have all gone from https:// to https:/

(one slash)

@GeneralUltra758
Copy link

GeneralUltra758 commented Dec 8, 2021

One small issue so far: All newlines in task descriptions are now literal "\n"

Fixed by cat ./db-mysql.sql | awk '{gsub(/\\n/, "\n")} 1'>./dbfixed.sq

Hyperlinks inside task descriptions have all gone from https:// to https:/

(one slash)

Inconsistent in my case somehow, and only one broken link, didn't bother to fix

Also I HIGHLY advise using this command to import the data:
mysql -h <dbhost> -u <dbuser> --password=<db password> <dbname> < /dbfixed.sql
as your way of using the source command hides syntax errors.
In my case the groups table still had a error in it
the line was: INSERT INTO "groups" but should be INSERT INTO `groups`

By using source the error just gets spammed away and left unseen if you cant scroll up far enougth.
use the command above and if it fails due to a syntax error:

  1. fix the error in the sql file
  2. drop the database
  3. recreate the sql db
  4. rerun the common.php
  5. and try again

That way you should have 100% of data imported
also i noticed a odd issue i had to fix:

If you use automatic actions then search the sql file for INSERT INTO actions and check if the actions path is separated by \\ instead of / as it was for some of my actions
example:
wrong:

INSERT INTO actions (`id`,`project_id`,`event_name`,`action_name`) VALUES(8,1,'task.move.column','/Kanboard/Plugin/Group_assign/Action/AssignGroup');
INSERT INTO actions (`id`,`project_id`,`event_name`,`action_name`) VALUES(9,1,'task.move.column','/Kanboard/Plugin/Group_assign/Action/AssignGroup');

correct:

INSERT INTO actions (`id`,`project_id`,`event_name`,`action_name`) VALUES(8,1,'task.move.column','\\Kanboard\\Plugin\\Group_assign\\Action\\AssignGroup');
INSERT INTO actions (`id`,`project_id`,`event_name`,`action_name`) VALUES(9,1,'task.move.column','\\Kanboard\\Plugin\\Group_assign\\Action\\AssignGroup');

edit: also works on KB 1.2.20

@minhhieple97
Copy link

I'm migrating kanboard from sqlite to mysql, i have created db-mysql.sql and run command souce db-mysql.sql.
But it seem that file db-mysql.sql has not created tables like users, tasks....
The error shows up like this

image
Do you have any suggestion ?
Thank you so much ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants