Mattermost restore failed

:uk:/:us: English

My YunoHost server

Hardware: VPS bought online 3vcpu & 4gb ram
YunoHost version: 4.2.8.2
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain: Full migration from a built-in backup

Description of my issue

Hello!
I’m in the process of migrating to a new server (VPS to VPS).
I made a complete backup with the built-in tool.

I restored said backup instead of the post-install on the new server.
Everything worked great except the mattermost app.

I tried to resore a single backup containing the app but the same errors appeared.
Here are the full logs

The error seems to happen around:

2021-09-09 13:24:29,160: DEBUG - + systemctl start mattermost
2021-09-09 13:27:20,642: WARNING - Job for mattermost.service failed because the control process exited with error code.

Additional debug

I ran journalctl -u mattermost --no-pager --no-hostname | tail -n 50 found here.

Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.8438184,"caller":"app/web_hub.go:93","msg":"Starting websocket hubs","number_of_hubs":6}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.8442833,"caller":"i18n/i18n.go:93","msg":"Loaded system translations","for locale":"en","from locale":"/var/www/mattermost/i18n/en.json"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.8468254,"caller":"sqlstore/store.go:308","msg":"Pinging SQL","database":"master"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.8476284,"caller":"sqlstore/store.go:308","msg":"Pinging SQL","database":"migrations"}
Sep 09 13:07:13 mattermost[17267]: {"level":"warn","ts":1631185633.8795004,"caller":"sqlstore/store.go:1191","msg":"Could not create foreign key: Error 1005: Can't create table `mattermost`.`RetentionPoliciesChannels` (errno: 121 \"Duplicate key on write or update\")"}
Sep 09 13:07:13 mattermost[17267]: {"level":"warn","ts":1631185633.8829622,"caller":"sqlstore/store.go:1191","msg":"Could not create foreign key: Error 1005: Can't create table `mattermost`.`RetentionPoliciesTeams` (errno: 121 \"Duplicate key on write or update\")"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9207382,"caller":"app/server.go:569","msg":"Current version is 5.38.2 (5.39.2/Thu Aug 26 12:48:32 UTC 2021/cc3edaef3420b785e8e0889edfc122881fc147dc/none)","current_version":"5.38.2","build_number":"5.39.2","build_date":"Thu Aug 26 12:48:32 UTC 2021","build_hash":"cc3edaef3420b785e8e0889edfc122881fc147dc","build_hash_enterprise":"none"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9208019,"caller":"app/server.go:580","msg":"Team Edition Build","enterprise_build":false}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9208207,"caller":"app/server.go:584","msg":"Printing current working","directory":"/var/www/mattermost"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9208322,"caller":"app/server.go:585","msg":"Loaded config","source":"file:///var/www/mattermost/config/config.json"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9253705,"caller":"sqlstore/post_store.go:2115","msg":"Post.Message has size restrictions","max_characters":16383,"max_bytes":65535}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9289012,"caller":"jobs/workers.go:135","msg":"Starting workers"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.929534,"caller":"jobs/schedulers.go:116","msg":"Starting schedulers."}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9317195,"caller":"app/license.go:88","msg":"License key from https://mattermost.com required to unlock enterprise features."}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9468296,"caller":"mlog/log.go:237","msg":"Starting up plugins"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9469004,"caller":"app/plugin.go:258","msg":"Syncing plugins from the file store"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.9586377,"caller":"app/plugin.go:318","msg":"Syncing plugin from file store","bundle":"plugins/com.mattermost.plugin-incident-management.tar.gz"}
Sep 09 13:07:13 mattermost[17267]: {"level":"info","ts":1631185633.95883,"caller":"app/plugin.go:318","msg":"Syncing plugin from file store","bundle":"plugins/com.github.matterpoll.matterpoll.tar.gz"}
Sep 09 13:07:16 mattermost[17267]: {"level":"error","ts":1631185636.027731,"caller":"mlog/sugar.go:25","msg":"Not activating plugin because diagnostics are disabled","plugin_id":"com.mattermost.nps"}
Sep 09 13:07:16 mattermost[17267]: {"level":"error","ts":1631185636.0333548,"caller":"app/plugin.go:887","msg":"Failed to install prepackaged plugin","path":"/var/www/mattermost/prepackaged_plugins/mattermost-plugin-nps-v1.1.0-linux-amd64.tar.gz","error":"Failed to install extracted prepackaged plugin /var/www/mattermost/prepackaged_plugins/mattermost-plugin-nps-v1.1.0-linux-amd64.tar.gz: installExtractedPlugin: Unable to restart plugin on upgrade., Not activating plugin because diagnostics are disabled","errorVerbose":"installExtractedPlugin: Unable to restart plugin on upgrade., Not activating plugin because diagnostics are disabled\nFailed to install extracted prepackaged plugin /var/www/mattermost/prepackaged_plugins/mattermost-plugin-nps-v1.1.0-linux-amd64.tar.gz\ngithub.com/mattermost/mattermost-server/v5/app.(*Server).processPrepackagedPlugin\n\tgithub.com/mattermost/mattermost-server/v5/app/plugin.go:939\ngithub.com/mattermost/mattermost-server/v5/app.(*Server).processPrepackagedPlugins.func2\n\tgithub.com/mattermost/mattermost-server/v5/app/plugin.go:885\nruntime.goexit\n\truntime/asm_amd64.s:1371"}
Sep 09 13:07:16 mattermost[17267]: {"level":"error","ts":1631185636.6708355,"caller":"mlog/sugar.go:25","msg":"Not activating plugin because diagnostics are disabled","plugin_id":"com.mattermost.nps"}
Sep 09 13:07:16 mattermost[17267]: {"level":"error","ts":1631185636.6727967,"caller":"mlog/log.go:251","msg":"Unable to activate plugin","plugin_id":"com.mattermost.nps","error":"Not activating plugin because diagnostics are disabled"}
Sep 09 13:07:16 mattermost[17267]: {"level":"error","ts":1631185636.739395,"caller":"mlog/sugar.go:25","msg":"Not activating plugin because diagnostics are disabled","plugin_id":"com.mattermost.nps"}
Sep 09 13:07:16 mattermost[17267]: {"level":"error","ts":1631185636.7411225,"caller":"mlog/log.go:251","msg":"Unable to activate plugin","plugin_id":"com.mattermost.nps","error":"Not activating plugin because diagnostics are disabled"}
Sep 09 13:07:17 mattermost[17267]: {"level":"info","ts":1631185637.0012233,"caller":"app/server.go:1177","msg":"Starting Server..."}
Sep 09 13:07:17 mattermost[17267]: {"level":"info","ts":1631185637.0013652,"caller":"app/server.go:1253","msg":"Server is listening on 127.0.0.1:8065","address":"127.0.0.1:8065"}
Sep 09 13:07:17 mattermost[17267]: {"level":"info","ts":1631185637.001393,"caller":"commands/server.go:129","msg":"Sending systemd READY notification."}
Sep 09 13:07:17 systemd[1]: Started Mattermost.
Sep 09 13:07:21 mattermost[17267]: {"level":"error","ts":1631185641.0220563,"caller":"log/log.go:184","msg":"[ERR] plugin: plugin acceptAndServe error: timeout waiting for accept","source":"stdlog"}
Sep 09 13:07:21 mattermost[17267]: {"level":"error","ts":1631185641.6647553,"caller":"log/log.go:184","msg":"[ERR] plugin: plugin acceptAndServe error: timeout waiting for accept","source":"stdlog"}
Sep 09 13:07:21 mattermost[17267]: {"level":"error","ts":1631185641.735015,"caller":"log/log.go:184","msg":"[ERR] plugin: plugin acceptAndServe error: timeout waiting for accept","source":"stdlog"}
Sep 09 13:08:02 systemd[1]: Stopping Mattermost...
Sep 09 13:08:02 mattermost[17267]: {"level":"info","ts":1631185682.4105725,"caller":"app/server.go:973","msg":"Stopping Server..."}
Sep 09 13:08:02 mattermost[17267]: {"level":"info","ts":1631185682.4106355,"caller":"app/web_hub.go:113","msg":"stopping websocket hub connections"}
Sep 09 13:08:02 mattermost[17267]: {"level":"info","ts":1631185682.4106696,"caller":"app/plugin.go:335","msg":"Shutting down plugins"}
Sep 09 13:08:02 mattermost[17267]: {"level":"warn","ts":1631185682.4107287,"caller":"plugin/hclog_adapter.go:70","msg":"error closing client during Kill","plugin_id":"com.mattermost.plugin-incident-management","wrapped_extras":"errconnection is shut down"}
Sep 09 13:08:02 mattermost[17267]: {"level":"warn","ts":1631185682.4107416,"caller":"plugin/hclog_adapter.go:72","msg":"plugin failed to exit gracefully","plugin_id":"com.mattermost.plugin-incident-management"}
Sep 09 13:08:02 mattermost[17267]: {"level":"info","ts":1631185682.4170778,"caller":"jobs/workers.go:340","msg":"Stopped workers"}
Sep 09 13:08:02 mattermost[17267]: {"level":"info","ts":1631185682.4171255,"caller":"jobs/schedulers.go:187","msg":"Stopping schedulers."}
Sep 09 13:08:02 mattermost[17267]: {"level":"info","ts":1631185682.4171367,"caller":"jobs/schedulers.go:119","msg":"Schedulers stopped."}
Sep 09 13:08:02 mattermost[17267]: {"level":"info","ts":1631185682.4172873,"caller":"app/server.go:1072","msg":"Server stopped"}
Sep 09 13:08:02 systemd[1]: mattermost.service: Succeeded.
Sep 09 13:08:02 systemd[1]: Stopped Mattermost.
Sep 09 13:08:25 systemd[1]: Starting Mattermost...
Sep 09 13:11:16 systemd[1]: mattermost.service: Main process exited, code=exited, status=102/n/a
Sep 09 13:11:16 systemd[1]: mattermost.service: Failed with result 'exit-code'.
Sep 09 13:11:16 systemd[1]: Failed to start Mattermost.
Sep 09 13:11:19 systemd[1]: mattermost.service: Service RestartSec=100ms expired, scheduling restart.
Sep 09 13:11:19 systemd[1]: mattermost.service: Failed to schedule restart job: Unit mattermost.service not found.
Sep 09 13:11:19 systemd[1]: mattermost.service: Failed with result 'exit-code'.

Thanks for the help!