# Mmctl export create fails with 'Limit exceeded for paging'

**URL:** <https://forum.mattermost.com/t/mmctl-export-create-fails-with-limit-exceeded-for-paging/23485>\
**Category:** Troubleshooting\
**Created:** [June 30, 2025, 1:06pm UTC](https://forum.mattermost.com/t/mmctl-export-create-fails-with-limit-exceeded-for-paging/23485 "2025-06-30T13:06:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![awky](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@awky](https://forum.mattermost.com/u/awky)\
**Post date:** [June 30, 2025, 1:06pm UTC](https://forum.mattermost.com/t/mmctl-export-create-fails-with-limit-exceeded-for-paging/23485/1 "2025-06-30T13:06:10Z")

</div>

**Summary**

While trying to create an export, `mmctl export create` fails with:

```auto
exportAllPosts: Limit exceeded for paging., failed to find Posts

```

**Steps to reproduce**

1. On the Mattermost server, create an export:

```auto
cd /opt/mattermost/
bin/mmctl --local export create

```

2. Check the logs:

```auto
tail -f /opt/mattermost/logs/mattermost.log

```

_Mattermost version 10.7.0_

**Expected behaviour**

Create a full export of the server, including messages.

**Observed behaviour**

No user messages are in the resulting export. The file itself is only 8 kb.

The export job fails with:

```auto
{"timestamp":"2025-06-25 14:02:26.690 +01:00","level":"error","msg":"SimpleWorker: job execution error","caller":"jobs/base_workers.go:86","worker_name":"ExportProcess","job_id":"16444px4epretb4b37yeowqsga","job_type":"export_process","job_create_at":"Jun 25 13:02:19.193","error":"exportAllPosts: Limit exceeded for paging., failed to find Posts: Error 1305 (42000): FUNCTION mattermost.JSON_ARRAYAGG does not exist"}

```

Full log available in the bug report:

> <https://github.com/mattermost/mattermost/issues/32125>
>
> \### Before you file a bug report
> 
> \- \[x\] I have checked the \[issue tracker\](https…://github.com/mattermost/mattermost/issues) and have not found an issue that matches the one I'm filing.
> \- \[x\] This issue is not a troubleshooting question. Troubleshooting questions go here: https://forum.mattermost.com/c/trouble-shoot/16.
> \- \[x\] This issue is not a feature request. You can request features and make product suggestions here: https://mattermost.uservoice.com/forums/306457-general/.
> \- \[x\] This issue reproduces on one of the \[currently supported server versions\](https://docs.mattermost.com/about/mattermost-server-releases.html#latest-releases).
> \- \[x\] I have read the \[contribution guidelines\](https://github.com/mattermost/mattermost/blob/master/CONTRIBUTING.md) and the \[Mattermost Handbook Contribution Guidelines\](https://handbook.mattermost.com/contributors/contributors/guidelines/contribution-guidelines).
> 
> \### Mattermost Server Version
> 
> 10.7.0
> 
> \### Operating System
> 
> Debian 10
> 
> \### Steps to reproduce
> 
> 1. On the Mattermost server, create an export:
> \`\`\`
> cd /opt/mattermost/
> bin/mmctl --local export create
> 2. Check the logs:
> \`\`\`
> tail -f /opt/mattermost/logs/mattermost.log
> \`\`\`
> 
> \### Expected behavior
> 
> Create a full export of server, including messages.
> 
> \### Observed behavior
> 
> No messages are in the resulting export. The file itself is only 8 kb:
> \`\`\`
> du -sh /var/mattermost/export/16444px4epretb4b37yeowqsga\_export.zip
> 8.0K	/var/mattermost/export/16444px4epretb4b37yeowqsga\_export.zip
> \`\`\`
> 
> \### Log Output
> 
> \`\`\`shell
> {"timestamp":"2025-06-25 14:02:26.667 +01:00","level":"info","msg":"Bulk export: exporting version","caller":"app/export.go:138","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193"}
> {"timestamp":"2025-06-25 14:02:26.667 +01:00","level":"info","msg":"Bulk export: exporting team schemes","caller":"app/export.go:312","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193"}
> {"timestamp":"2025-06-25 14:02:26.668 +01:00","level":"info","msg":"Bulk export: exporting channel schemes","caller":"app/export.go:317","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193"}
> {"timestamp":"2025-06-25 14:02:26.669 +01:00","level":"info","msg":"Bulk export: exporting roles","caller":"app/export.go:322","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193"}
> {"timestamp":"2025-06-25 14:02:26.670 +01:00","level":"info","msg":"Bulk export: exporting teams","caller":"app/export.go:149","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193"}
> {"timestamp":"2025-06-25 14:02:26.671 +01:00","level":"info","msg":"Bulk export: exporting channels","caller":"app/export.go:155","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193"}
> {"timestamp":"2025-06-25 14:02:26.673 +01:00","level":"info","msg":"Bulk export: exporting users","caller":"app/export.go:160","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193"}
> {"timestamp":"2025-06-25 14:02:26.686 +01:00","level":"info","msg":"Bulk export: exporting bots","caller":"app/export.go:166","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193"}
> {"timestamp":"2025-06-25 14:02:26.689 +01:00","level":"info","msg":"Bulk export: exporting posts","caller":"app/export.go:173","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193"}
> {"timestamp":"2025-06-25 14:02:26.690 +01:00","level":"error","msg":"SimpleWorker: job execution error","caller":"jobs/base\_workers.go:86","worker\_name":"ExportProcess","job\_id":"16444px4epretb4b37yeowqsga","job\_type":"export\_process","job\_create\_at":"Jun 25 13:02:19.193","error":"exportAllPosts: Limit exceeded for paging., failed to find Posts: Error 1305 (42000): FUNCTION mattermost.JSON\_ARRAYAGG does not exist"}
> \`\`\`
> 
> \### Additional Information
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![john.combs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.combs/32/7118_2.png) [@john.combs](https://forum.mattermost.com/u/john.combs)\
**Post date:** [July 18, 2025, 12:24am UTC](https://forum.mattermost.com/t/mmctl-export-create-fails-with-limit-exceeded-for-paging/23485/2 "2025-07-18T00:24:18Z")

</div>

Hi @awky! Have you by any chance tried updating MySQL to see if that might fix the issue? Alternatively, I’d also recommend checking out this doc around software/hardware requirements to see if might help surface any additional clues: [Software and hardware requirements - Mattermost documentation](https://docs.mattermost.com/deploy/software-hardware-requirements.html)

---

<div class="post-metadata">

**Author:** ![awky](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@awky](https://forum.mattermost.com/u/awky)\
**Post date:** [July 21, 2025, 10:27pm UTC](https://forum.mattermost.com/t/mmctl-export-create-fails-with-limit-exceeded-for-paging/23485/3 "2025-07-21T22:27:57Z")

</div>

Hello, thanks for the reply! Now I’m looking at the docs it looks like MariaDB is even less supported than MySQL (the reason for us starting this migration 😁)  
This is our MariaDB / MySQL version:

```auto
mysql --version
mysql Ver 15.1 Distrib 10.3.39-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

```

And this is our Debian version:

```auto
cat /etc/issue       
Debian GNU/Linux 10 \n \l

```

Do you recommend upgrading MySQL before attempting an export?  
We’ve already got a functional Debian 12 + Postgres Mattermost ready to _import_. Cheers 🙂

---

<div class="post-metadata">

**Author:** ![john.combs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.combs/32/7118_2.png) [@john.combs](https://forum.mattermost.com/u/john.combs)\
**Post date:** [July 23, 2025, 12:35am UTC](https://forum.mattermost.com/t/mmctl-export-create-fails-with-limit-exceeded-for-paging/23485/4 "2025-07-23T00:35:41Z")

</div>

Thanks for the update, @awky! Given that MariaDB 10.3 is quite outdated and lacks support for JSON functions like `JSON_ARRAYAGG`, I’d definitely recommend completing the switch to MySQL 8+ or PostgreSQL before running the export. Sounds like your Debian 12 + Postgres setup is right on track! 😊

---

<div class="post-metadata">

**Author:** ![awky](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@awky](https://forum.mattermost.com/u/awky)\
**Post date:** [July 28, 2025, 12:28pm UTC](https://forum.mattermost.com/t/mmctl-export-create-fails-with-limit-exceeded-for-paging/23485/5 "2025-07-28T12:28:45Z")

</div>

Thanks for the help! Using a newer version of MariaDB solved my problem.

For the benefit of future readers:

### The problem

MariaDB versions before 10.5.0 do no support JSON\_ARRAYAGG [[source](https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_arrayagg)]. This is required for `mmctl export` to work.

### The solution

Temporarily switch Mattermost to a newer MariaDB. You could upgrade in-place, but that seemed dangerous to me.

#### Set up a new MariaDB server

I created a Debian 12 server, which is new enough to install MariaDB 10.11.11.

1. Install MariaDB on a new server:

```auto
# root@new-server
apt update
apt install mariadb-server

```

2. Configure it to listen to remote connections: Edit `/etc/mysql/mariadb.conf.d/50-server.cnf`

```diff
  # Instead of skip-networking the default is now to listen only on
  # localhost which is more compatible and is not less secure.
- bind-address = 127.0.0.1
+ bind-address = 0.0.0.0

```

3. Restart MariaDB:

```auto
service mariadb restart

```

4. If using a firewall you might need to open the MariaDB port, for example:

```auto
ufw allow 3306/tcp
ufw reload

```

5. Prepare the Mattermost database (you need to use the **same** DB user password as your original instance, replace ‘db\_user\_password’)

```auto
# root@new-server
mysql

```

```sql
CREATE DATABASE mattermost;
CREATE USER 'mattermost'@'%' IDENTIFIED BY 'db_user_password';
GRANT ALL PRIVILEGES ON mattermost.* TO 'mattermost'@'%';

```

#### Copy the data across

1. On the old server, perform a database dump:

```auto
# root@old-server
mysqldump mattermost > mattermost_dump.sql

```

2. Copy the `mattermost_dump.sql` file to the new server.
3. On the new server, restore the data:

```auto
# Note: I'm logging in with the 'mattermost' database user and requesting a password
# prompt with '-p'. This isn't strictly necessary ('mysql mattermost' would work) but
# it's a nice test that the user has the right permissions.
cat mattermost_dump.sql | mysql -u mattermost -p mattermost

```

#### Switch Mattermost to the new MariaDB server

1. On the old server, edit the Mattermost config `/opt/mattermost/config/config.json` – replacing ‘db\_user\_password’ and ‘my\_db\_ip\_address’.

```diff
"SqlSettings": {
    "DriverName": "mysql",
- "DataSource": "mattermost:db_user_password@tcp(localhost:58103)/mattermost?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s",
+ "DataSource": "mattermost:db_user_password@tcp(my_db_ip_address:58103)/mattermost?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s",
    "DataSourceReplicas": [],

```

2. Restart Mattermost:

```auto
service mattermost restart

```

#### Final result

At this point your set up looks like this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/a/a61d31df24aed2a7a0efcc0a52c4731b9f1b7786.png)

And you are free to run `mmctl export create` 🙂
