# Mattermost Boards Plugin Failed to start after update

**URL:** <https://forum.mattermost.com/t/mattermost-boards-plugin-failed-to-start-after-update/15878>\
**Category:** Troubleshooting\
**Created:** [May 10, 2023, 8:20am UTC](https://forum.mattermost.com/t/mattermost-boards-plugin-failed-to-start-after-update/15878 "2023-05-10T08:20:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vdlam-interlink](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/vdlam-interlink/32/6756_2.png) [@vdlam-interlink](https://forum.mattermost.com/u/vdlam-interlink)\
**Post date:** [May 10, 2023, 8:20am UTC](https://forum.mattermost.com/t/mattermost-boards-plugin-failed-to-start-after-update/15878/1 "2023-05-10T08:20:50Z")

</div>

**Summary**  
Hello, while the title is self-explanatory we would also like to elaborate further. We have been self-hosting Mattermost since the Early 5.x release, with the addition of Mattermost Board we were thrilled as we can now have a more centralized way of managing our Kanbans, all integrated in Mattermost. However, due to a wild-ride of mismanagement we have decided to switch back to other platforms for Kanban and Board was shelved for awhile.

At some point during this duration, one of our technician updated Mattermost from 5.x to 7.x completely skipping important updates. As a result of incomplete or faulty SQL table migration, Boards no longer works. As off today, we have decided to revive Boards and to salvage some of the old data left on there.

**Steps to reproduce**

Database: MySQL

Timeline of our updates:

2022-08-23: First update attempt: 6.4.2 → 7.2 (skipping important updates)

2022-11-16: Update attempt 6.4.2 → 6.7 → 7.0 -\>7.2 Boards was still not working

2022-12-06: No update was attempted however, MM logs showed this after some back tracking.

> {“timestamp”:“2022-12-01 06:04:28.982 +07:00”,“level”:“error”,“msg”:“Table creation / migration failed”,“caller”:“app/plugin\_api.go:974”,“plugin\_id”:“focalboard”,“error”:“"driver: mysql, message: failed when applying migration, command: apply\_migration, originalError: Error 1050: Table ‘focalboard\_teams’ already exists, query: \n\n\nRENAME TABLE focalboard\_workspaces TO focalboard\_teams;\nALTER TABLE focalboard\_blocks CHANGE workspace\_id channel\_id VARCHAR(36);\nALTER TABLE focalboard\_blocks\_history CHANGE workspace\_id channel\_id VARCHAR(36);\n\nALTER TABLE focalboard\_blocks ADD COLUMN board\_id VARCHAR(36);\nALTER TABLE focalboard\_blocks\_history ADD COLUMN board\_id VARCHAR(36);\nUPDATE focalboard\_blocks SET fields = JSON\_SET(fields, ‘$.columnCalculations’, cast(‘{}’ as json)) WHERE fields-\>‘$.columnCalculations’ = cast(‘’ as json);\n\nUPDATE focalboard\_blocks b\n JOIN (\n SELECT id, fields-\>‘$.columnCalculations’ as board\_calculations from focalboard\_blocks\n WHERE fields → ‘$.columnCalculations’ \<\> cast(‘{}’ as json)\n ) AS s on s.id = b.root\_id\n SET fields = JSON\_SET(fields, ‘$.columnCalculations’, cast(s.board\_calculations as json))\n WHERE b.fields-\>‘$.viewType’ = ‘table’\n AND b.type = ‘view’;\n\n\n\n\n/\* TODO: Migrate the columnCalculations at app level and remove it from the boards and boards\_history tables \*/CREATE TABLE IF NOT EXISTS focalboard\_boards (\n id VARCHAR(36) NOT NULL PRIMARY KEY,\n\n \n\t\n\tinsert\_at DATETIME(6) NOT NULL DEFAULT NOW(6),\n\n team\_id VARCHAR(36) NOT NULL,\n channel\_id VARCHAR(36),\n created\_by VARCHAR(36),\n modified\_by VARCHAR(36),\n type VARCHAR(1) NOT NULL,\n title TEXT NOT NULL,\n description TEXT,\n icon VARCHAR(256),\n show\_description BOOLEAN,\n is\_template BOOLEAN,\n template\_version INT DEFAULT 0,\n \n properties JSON,\n card\_properties JSON,\n \n \n \n create\_at BIGINT,\n update\_at BIGINT,\n delete\_at BIGINT\n) DEFAULT CHARACTER SET utf8mb4;\n\nCREATE INDEX idx\_board\_team\_id ON focalboard\_boards(team\_id, is\_template);\nCREATE INDEX idx\_board\_channel\_id ON focalboard\_boards(channel\_id);\n\nCREATE TABLE IF NOT EXISTS focalboard\_boards\_history (\n id VARCHAR(36) NOT NULL,\n\n \n\t\n\tinsert\_at DATETIME(6) NOT NULL DEFAULT NOW(6),\n\n team\_id VARCHAR(36) NOT NULL,\n channel\_id VARCHAR(36),\n created\_by VARCHAR(36),\n modified\_by VARCHAR(36),\n type VARCHAR(1) NOT NULL,\n title TEXT NOT NULL,\n description TEXT,\n icon VARCHAR(256),\n show\_description BOOLEAN,\n is\_template BOOLEAN,\n template\_version INT DEFAULT 0,\n \n properties JSON,\n card\_properties JSON,\n \n \n \n create\_at BIGINT,\n update\_at BIGINT,\n delete\_at BIGINT,\n\n PRIMARY KEY (id, insert\_at)\n) DEFAULT CHARACTER SET utf8mb4;\n \n \n INSERT INTO focalboard\_boards (\n SELECT B.id, B.insert\_at, C.TeamId, B.channel\_id, B.created\_by, B.modified\_by, C.Type,\n COALESCE(B.title, ‘’),\n COALESCE(JSON\_UNQUOTE(JSON\_EXTRACT(B.fields,‘$.description’)), ‘’),\n JSON\_UNQUOTE(JSON\_EXTRACT(B.fields,‘$.icon’)),\n COALESCE(B.fields-\>‘$.showDescription’, ‘false’) = ‘true’,\n COALESCE(JSON\_EXTRACT(B.fields, ‘$.isTemplate’), ‘false’) = ‘true’,\n COALESCE(B.fields-\>‘$.templateVer’, 0),\n ‘{}’, B.fields-\>‘$.cardProperties’, B.create\_at,\n B.update\_at, B.delete\_at\n FROM focalboard\_blocks AS B\n INNER JOIN Channels AS C ON C.Id=B.channel\_id\n WHERE B.type=‘board’\n );\n INSERT INTO focalboard\_boards\_history (\n SELECT B.id, B.insert\_at, C.TeamId, B.channel\_id, B.created\_by, B.modified\_by, C.Type,\n COALESCE(B.title, ‘’),\n COALESCE(JSON\_UNQUOTE(JSON\_EXTRACT(B.fields,‘$.description’)), ‘’),\n JSON\_UNQUOTE(JSON\_EXTRACT(B.fields,‘$.icon’)),\n COALESCE(B.fields-\>‘$.showDescription’, ‘false’) = ‘true’,\n COALESCE(JSON\_EXTRACT(B.fields, ‘$.isTemplate’), ‘false’) = ‘true’,\n COALESCE(B.fields-\>‘$.templateVer’, 0),\n ‘{}’, B.fields-\>‘$.cardProperties’, B.create\_at,\n B.update\_at, B.delete\_at\n FROM focalboard\_blocks\_history AS B\n INNER JOIN Channels AS C ON C.Id=B.channel\_id\n WHERE B.type=‘board’\n );\n \nUPDATE focalboard\_blocks SET board\_id=root\_id;\nUPDATE focalboard\_blocks\_history SET board\_id=root\_id;DELETE FROM focalboard\_blocks WHERE type = ‘board’;\nDELETE FROM focalboard\_blocks\_history WHERE type = ‘board’;CREATE TABLE IF NOT EXISTS focalboard\_board\_members (\n board\_id VARCHAR(36) NOT NULL,\n user\_id VARCHAR(36) NOT NULL,\n roles VARCHAR(64),\n scheme\_admin BOOLEAN,\n scheme\_editor BOOLEAN,\n scheme\_commenter BOOLEAN,\n scheme\_viewer BOOLEAN,\n PRIMARY KEY (board\_id, user\_id)\n) DEFAULT CHARACTER SET utf8mb4;\n\nCREATE INDEX idx\_boardmembers\_user\_id ON focalboard\_board\_members(user\_id);\nINSERT INTO focalboard\_board\_members (\n SELECT B.Id, CM.UserId, CM.Roles, TRUE, TRUE, FALSE, FALSE\n FROM focalboard\_boards AS B\n INNER JOIN ChannelMembers as CM ON CM.ChannelId=B.channel\_id\n WHERE CM.SchemeAdmin=True OR (CM.UserId=B.created\_by)\n);\n\n\n\n\n"”}

2023-05-01: We tried to take a peak at the database following this guide: [Error in Mattermost Boards after Upgrade to 7.5.1](https://forum.mattermost.com/t/error-in-mattermost-boards-after-upgrade-to-7-5-1/14614/7) (shout out to agriesser) and found out that 2 tables are missing focalboard\_boards", “focalboard\_boards\_member” and “focalboard\_boards\_history”.

> ±-----------------------------------+  
> | Tables\_in\_mattermost (focalboard%) |  
> ±-----------------------------------+  
> | focalboard\_blocks |  
> | focalboard\_blocks\_history |  
> | focalboard\_file\_info |  
> | focalboard\_notification\_hints |  
> | focalboard\_schema\_migrations |  
> | focalboard\_sessions |  
> | focalboard\_sharing |  
> | focalboard\_subscriptions |  
> | focalboard\_system\_settings |  
> | focalboard\_teams |  
> | focalboard\_users |  
> ±-----------------------------------+

**Expected behavior**  
Mattermost Boards working again.

**Observed behavior**  
Mattermost Boards failed to start and only return errors.

I can also provide more details if required. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [May 22, 2023, 6:34am UTC](https://forum.mattermost.com/t/mattermost-boards-plugin-failed-to-start-after-update/15878/2 "2023-05-22T06:34:43Z")

</div>

Hi @vdlam-interlink and welcome to the Mattermost forums!

I’m afraid you will have to go through the troubleshooting steps in the topic you linked yourself, since the error looks related. What’s the current max value in your `focalboard_schema_migrations` table?

---

<div class="post-metadata">

**Author:** ![vdlam-interlink](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/vdlam-interlink/32/6756_2.png) [@vdlam-interlink](https://forum.mattermost.com/u/vdlam-interlink)\
**Post date:** [May 23, 2023, 6:27am UTC](https://forum.mattermost.com/t/mattermost-boards-plugin-failed-to-start-after-update/15878/3 "2023-05-23T06:27:33Z")

</div>

Thanks for the reply agriesser!

After some careful digging, combined with Mattermost well documented user guides, github repo and support forum. I was finally been able to get Boards working again!

Thanks for the help!.
