# Error in migration-assist with creating postgres schema

**URL:** <https://forum.mattermost.com/t/error-in-migration-assist-with-creating-postgres-schema/23246>\
**Category:** Troubleshooting\
**Created:** [May 28, 2025, 1:49pm UTC](https://forum.mattermost.com/t/error-in-migration-assist-with-creating-postgres-schema/23246 "2025-05-28T13:49:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvilSneakers](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@EvilSneakers](https://forum.mattermost.com/u/EvilSneakers)\
**Post date:** [May 28, 2025, 1:49pm UTC](https://forum.mattermost.com/t/error-in-migration-assist-with-creating-postgres-schema/23246/1 "2025-05-28T13:49:48Z")

</div>

**Summary**  
Error in migration database from mysql to (PostgreSQL) 17.5 (Ubuntu 17.5-1.pgdg22.04+1)

**Steps to reproduce**

1. migration-assist mysql “\<MYSQL\_DSN\>” - sucsess
2. migration-assist postgres “\<POSTGRES\_DSN\>”  
–run-migrations  
–mattermost-version=“\<MATTERMOST\_VERSION\>” - error

**Expected behavior**  
Creating the PostgreSQL database schema

**Observed behavior**  
panic: runtime error: slice bounds out of range [1:0]

goroutine 1 [running]:  
[github.com/mattermost/migration-assist/internal/store.extractPostgresDatabaseNameFromURL(...)](http://github.com/mattermost/migration-assist/internal/store.extractPostgresDatabaseNameFromURL(...))  
/home/runner/work/migration-assist/migration-assist/internal/store/postgres.go:47  
[github.com/mattermost/migration-assist/internal/store.openPostgres](http://github.com/mattermost/migration-assist/internal/store.openPostgres)({0x7fff533236cd, 0x40})  
/home/runner/work/migration-assist/migration-assist/internal/store/postgres.go:23 +0x1fd  
[github.com/mattermost/migration-assist/internal/store.NewStore](http://github.com/mattermost/migration-assist/internal/store.NewStore)({0xd7d274?, 0xd7c88f?}, {0x7fff533236cd?, 0xd7b32d?})  
/home/runner/work/migration-assist/migration-assist/internal/store/store.go:44 +0x65  
[github.com/mattermost/migration-assist/cmd/migration-assist/commands.runTargetCheckCmdF](http://github.com/mattermost/migration-assist/cmd/migration-assist/commands.runTargetCheckCmdF)(0xc0000fbb08, {0xc0003094d0, 0x1, 0xd7b32d?})  
/home/runner/work/migration-assist/migration-assist/cmd/migration-assist/commands/postgres.go:71 +0x14c  
[github.com/spf13/cobra.(\*Command).execute](http://github.com/spf13/cobra.(*Command).execute)(0xc0000fbb08, {0xc000309440, 0x3, 0x3})  
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0xaaa  
[github.com/spf13/cobra.(\*Command).ExecuteC(0x14e9f20)](http://github.com/spf13/cobra.(*Command).ExecuteC(0x14e9f20))  
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff  
[github.com/spf13/cobra.(\*Command).Execute(...)](http://github.com/spf13/cobra.(*Command).Execute(...))  
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039  
main.main()  
/home/runner/work/migration-assist/migration-assist/cmd/migration-assist/main.go:31 +0x115

---

<div class="post-metadata">

**Author:** ![john.oliver](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.oliver/32/6436_2.png) [@john.oliver](https://forum.mattermost.com/u/john.oliver)\
**Post date:** [May 28, 2025, 2:08pm UTC](https://forum.mattermost.com/t/error-in-migration-assist-with-creating-postgres-schema/23246/2 "2025-05-28T14:08:51Z")

</div>

What version of MySQL are you on (and it needs to be MySQL, not MariaDB)? And what version of Mattermost? How big is your database, how many users, etc.?

---

<div class="post-metadata">

**Author:** ![EvilSneakers](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@EvilSneakers](https://forum.mattermost.com/u/EvilSneakers)\
**Post date:** [May 28, 2025, 2:36pm UTC](https://forum.mattermost.com/t/error-in-migration-assist-with-creating-postgres-schema/23246/3 "2025-05-28T14:36:05Z")

</div>

Current MySQL and Mattermost  
mysql Ver 8.0.42-0ubuntu0.22.04.1 for Linux on x86\_64 ((Ubuntu))  
Mattermost version: 10.1.2  
Database schema version: 127  
Build number: 11462506876  
Database: mysql

Database is around 540 Mb  
±---------------------------------±----------+  
| Table | Size (MB) |  
±---------------------------------±----------+  
| Posts | 357 |  
| FileInfo | 72 |  
| Jobs | 58 |  
| LinkMetadata | 14 |  
| Audits | 13 |  
| ThreadMemberships | 13 |  
| Reactions | 4 |  
| Threads | 4 |  
| focalboard\_blocks | 2 |  
| focalboard\_blocks\_history | 1 |  
| Preferences | 1 |  
| ChannelMembers | 1 |  
| Channels | 0 |  
| focalboard\_boards\_history | 0 |

We have around 30 users, only 12 is active (others are deactivated)

---

<div class="post-metadata">

**Author:** ![john.oliver](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.oliver/32/6436_2.png) [@john.oliver](https://forum.mattermost.com/u/john.oliver)\
**Post date:** [May 28, 2025, 5:51pm UTC](https://forum.mattermost.com/t/error-in-migration-assist-with-creating-postgres-schema/23246/4 "2025-05-28T17:51:10Z")

</div>

10.1 is pretty old. Can you update to 10.5.7? That’ll make sure you have the most recent migration tools. There are a few mentions in the changelog that suggest that may be the fix.

If not… I’m not a database expert, I can ask internally for more ideas. [Mattermost](https://community.mattermost.com/core/channels/peer-to-peer-help) could be a good resource too.

---

<div class="post-metadata">

**Author:** ![EvilSneakers](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@EvilSneakers](https://forum.mattermost.com/u/EvilSneakers)\
**Post date:** [May 29, 2025, 5:53am UTC](https://forum.mattermost.com/t/error-in-migration-assist-with-creating-postgres-schema/23246/5 "2025-05-29T05:53:22Z")

</div>

I’ll try to update to 10.5.7 and try migration again and will return with results.

---

<div class="post-metadata">

**Author:** ![EvilSneakers](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@EvilSneakers](https://forum.mattermost.com/u/EvilSneakers)\
**Post date:** [May 29, 2025, 9:06am UTC](https://forum.mattermost.com/t/error-in-migration-assist-with-creating-postgres-schema/23246/6 "2025-05-29T09:06:07Z")

</div>

Mattermost: 10.5.7  
Database version: 135  
Build number: 15186613021  
Database: mysql

Same error  
panic: runtime error: slice bounds out of range [1:0]

goroutine 1 [running]:  
[github.com/mattermost/migration-assist/internal/store.extractPostgresDatabaseNameFromURL(...)](http://github.com/mattermost/migration-assist/internal/store.extractPostgresDatabaseNameFromURL(...))  
/home/runner/work/migration-assist/migration-assist/internal/store/postgres.go:47  
[github.com/mattermost/migration-assist/internal/store.openPostgres](http://github.com/mattermost/migration-assist/internal/store.openPostgres)({0x7ffe6bd8c6b6, 0x40})  
/home/runner/work/migration-assist/migration-assist/internal/store/postgres.go:23 +0x1fd  
[github.com/mattermost/migration-assist/internal/store.NewStore](http://github.com/mattermost/migration-assist/internal/store.NewStore)({0xd7d274?, 0xd7c88f?}, {0x7ffe6bd8c6b6?, 0xd7b32d?})  
/home/runner/work/migration-assist/migration-assist/internal/store/store.go:44 +0x65  
[github.com/mattermost/migration-assist/cmd/migration-assist/commands.runTargetCheckCmdF](http://github.com/mattermost/migration-assist/cmd/migration-assist/commands.runTargetCheckCmdF)(0xc000426308, {0xc00038afc0, 0x1, 0xd7b32d?})  
/home/runner/work/migration-assist/migration-assist/cmd/migration-assist/commands/postgres.go:71 +0x14c  
[github.com/spf13/cobra.(\*Command).execute](http://github.com/spf13/cobra.(*Command).execute)(0xc000426308, {0xc00038af30, 0x3, 0x3})  
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0xaaa  
[github.com/spf13/cobra.(\*Command).ExecuteC(0x14e9f20)](http://github.com/spf13/cobra.(*Command).ExecuteC(0x14e9f20))  
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff  
[github.com/spf13/cobra.(\*Command).Execute(...)](http://github.com/spf13/cobra.(*Command).Execute(...))  
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039  
main.main()  
/home/runner/work/migration-assist/migration-assist/cmd/migration-assist/main.go:31 +0x115

looks like it’s error within migration-assist tool. Tried 0.2 and 0.4

---

<div class="post-metadata">

**Author:** ![EvilSneakers](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@EvilSneakers](https://forum.mattermost.com/u/EvilSneakers)\
**Post date:** [May 29, 2025, 11:05am UTC](https://forum.mattermost.com/t/error-in-migration-assist-with-creating-postgres-schema/23246/7 "2025-05-29T11:05:19Z")

</div>

The problem was with # symbol in postgresql password for mmsuer.  
The most stupid thing that same symbol in migration assist with mysql password user works just fine. So if someone have same problem as me - use password without ANY symbols and add them later by changing password and reconfiguring configuration.json file.
