KnexTimeoutError: Knex: Timeout acquiring a connection. Error on Migration V4 -> V5

System Information
  • Strapi Version: 5.10.0:
  • Mac:
  • Mysql:
  • Node Version:v20.18.0:
  • NPM Version:10.8.2:

Hi,

I am experiencing slow migration performance in Strapi v5 when using MySQL as the database. The migration process takes an unusually long time as I need to migrate almost 350mb data, causing timeouts and leading to the following error:

KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
at Client_MySQL2.acquireConnection (path/to/your/project/node_modules/knex/lib/client.js:332:26)
at runNextTicks (node:internal/process/task_queues:60:5)
at listOnTimeout (node:internal/timers:545:9)
at process.processTimers (node:internal/timers:519:7)
at async Runner.ensureConnection (path/to/your/project/node_modules/knex/lib/execution/runner.js:305:28)
at async Runner.run (path/to/your/project/node_modules/knex/lib/execution/runner.js:30:19)
at async Object.execute (path/to/your/project/packages/@strapi/database/dist/index.js:5743:30)
at async Object.findOne (path/to/your/project/packages/@strapi/database/dist/index.js:6544:28)
at async emitEvent (path/to/your/project/packages/@strapi/core/dist/index.js:7297:24) {
sql: undefined,
bindings: undefined
}

Any one has any experience with migration big data from v4->v5 ? At some point always I get that error, I need to complete migration soon any workarounds would be appreciated