mattermost / migration-assist

A helper tool to automate MySQL -> Postgres migration for Mattermost
https://docs.mattermost.com/deploy/postgres-migration.html
2 stars 2 forks source link

could not parse mysql DSN: no match found #19

Open Bolderus opened 3 weeks ago

Bolderus commented 3 weeks ago

on step 3 - Generate a pgloader configuration but I am getting error "An Error Occurred: could not generate config: could not parse mysql DSN: no match found"

I am trying ./migration-assist pgloader --mysql="mmuser:mypassword@tcp(localhost:3306)/mattermost" --postgres="mmuser:mypassword@localhost:5432/mattermost"> migration.load

Also trying only ./migration-assist pgloader Getting same error "An Error Occurred: could not generate config: could not parse mysql DSN: no match found"

Anybody can help me to solve problem ?

Bolderus commented 2 weeks ago

any idea about error ? what I need to do solve problem ? What I am missing ?

isacikgoz commented 2 weeks ago

Thanks for the feedback @Bolderus! Is there any semicolons etc on your actual mysql user? On the postgres DSN though, you should add postgres:// prefix to that.

Bolderus commented 2 weeks ago

Dear @isacikgoz I dont have semicolons on my mysql user nor postgres user both is mmuser But mmusers passwords have plus sign "+" and "@" sign , my postgres and mysql user password is "4a5v6b7HH+@". As you can see below, I tried many methods but none of them worked. what can be the problem ?

./migration-assist pgloader --mysql="mmuser:4a5v6b7HH+@@tcp(localhost:3306)/mattermost" --postgres="mmuser:4a5v6b7HH+@@localhost:5432/mattermost"> migration.load An Error Occurred: could not generate config: could not parse mysql DSN: no match found

./migration-assist pgloader --mysql="<mmuser:4a5v6b7HH+@@tcp(localhost:3306)/mattermost" postgres://"mmuser:4a5v6b7HH+@@localhost:5432/mattermost"> migration.load An Error Occurred: could not generate config: could not parse mysql DSN: no match found

./migration-assist pgloader --mysql="mmuser:4a5v6b7HH+@@tcp(localhost:3306)/mattermost" postgres://"mmuser:4a5v6b7HH+@@localhost:5432/mattermost"> migration.load An Error Occurred: could not generate config: could not parse mysql DSN: no match found

./migration-assist pgloader --mysql="mmuser:4a5v6b7HH+@@tcp(localhost:3306)/mattermost" postgres://mmuser:4a5v6b7HH+@@localhost:5432/mattermost> migration.load An Error Occurred: could not generate config: could not parse mysql DSN: no match found

./migration-assist pgloader --mysql=mmuser:4a5v6b7HH+@@tcp(localhost:3306)/mattermost postgres://mmuser:4a5v6b7HH+@@localhost:5432/mattermost> migration.load -bash: syntax error near unexpected token `('

./migration-assist pgloader mysql="mmuser:4a5v6b7HH+@@tcp(localhost:3306)/mattermost" postgres://mmuser:4a5v6b7HH+@@localhost:5432/mattermost> migration.load An Error Occurred: could not generate config: could not parse mysql DSN: no match found

./migration-assist pgloader mysql"mmuser:4a5v6b7HH+@@tcp(localhost:3306)/mattermost" postgres://mmuser:4a5v6b7HH+@@localhost:5432/mattermost> migration.load An Error Occurred: could not generate config: could not parse mysql DSN: no match found

./migration-assist pgloader mysql "mmuser:4a5v6b7HH+@@tcp(localhost:3306)/mattermost" postgres://mmuser:4a5v6b7HH+@@localhost:5432/mattermost> migration.load An Error Occurred: could not generate config: could not parse mysql DSN: no match found

./migration-assist pgloader mysql "mmuser:4a5v6b7HH+@@tcp(localhost:3306)/mattermost" postgres "postgres://mmuser:4a5v6b7HH+@@localhost:5432/mattermost"> migration.load An Error Occurred: could not generate config: could not parse mysql DSN: no match found

stafot commented 2 weeks ago

@isacikgoz most likely is parsing failure due to special character @

Bolderus commented 1 week ago

Changing password solved and using password without "@" completed all steps . But when I checked "./pgloader calls.load > calls.log" There are alot of errors as you can see below. ERROR Database error 23505 How can I solve ?

WARNING Source column "mattermost"."ChannelMembers"."schemeuser" is casted to type "smallint" which is not the same as "boolean", the type of current target database column "mattermost"."channelmembers"."schemeuser". WARNING Source column "mattermost"."ChannelMembers"."schemeadmin" is casted to type "smallint" which is not the same as "boolean", the type of current target database column "mattermost"."channelmembers"."schemeadmin". WARNING Source column "mattermost"."ChannelMembers"."schemeguest" is casted to type "smallint" which is not the same as "boolean", the type of current target database column "mattermost"."channelmembers"."schemeguest". WARNING Source column "mattermost"."Channels"."type" is casted to type "channel_type" which is not the same as "mattermost.channel_type", the type of current target database column "mattermost"."channels"."type". WARNING Source column "mattermost"."OutgoingOAuthConnections"."oauthtokenurl" is casted to type "varchar" which is not the same as "text", the type of current target database column "mattermost"."outgoingoauthconnections"."oauthtokenurl". WARNING Source column "mattermost"."OutgoingOAuthConnections"."granttype" is casted to type "varchar" which is not the same as "mattermost.outgoingoauthconnections_granttype", the type of current target database column "mattermost"."outgoingoauthconnections"."granttype". WARNING Source column "mattermost"."RetentionIdsForDeletion"."ids" is casted to type "jsonb" which is not the same as "character varying[]", the type of current target database column "mattermost"."retentionidsfordeletion"."ids". WARNING Source column "mattermost"."TeamMembers"."schemeuser" is casted to type "smallint" which is not the same as "boolean", the type of current target database column "mattermost"."teammembers"."schemeuser". WARNING Source column "mattermost"."TeamMembers"."schemeadmin" is casted to type "smallint" which is not the same as "boolean", the type of current target database column "mattermost"."teammembers"."schemeadmin". WARNING Source column "mattermost"."TeamMembers"."schemeguest" is casted to type "smallint" which is not the same as "boolean", the type of current target database column "mattermost"."teammembers"."schemeguest". WARNING Source column "mattermost"."Teams"."type" is casted to type "team_type" which is not the same as "mattermost.team_type", the type of current target database column "mattermost"."teams"."type". WARNING Source column "mattermost"."UploadSessions"."type" is casted to type "upload_session_type" which is not the same as "mattermost.upload_session_type", the type of current target database column "mattermost"."uploadsessions"."type". WARNING PostgreSQL warning: constraint "fk_retentionpolicieschannels_retentionpolicies" of relation "retentionpolicieschannels" does not exist, skipping WARNING PostgreSQL warning: constraint "fk_retentionpoliciesteams_retentionpolicies" of relation "retentionpoliciesteams" does not exist, skipping ERROR Database error 23505: duplicate key value violates unique constraint "threadmemberships_pkey" DETAIL: Key (postid, userid)=(1113y88wm3fdmmw1kxt9gr1z3y, 1o4c6cimsty89ycuoujipjjm9y) already exists. CONTEXT: COPY threadmemberships, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "reactions_pkey" DETAIL: Key (postid, userid, emojiname)=(111swrw61jyqzp96x7nutgho5e, 1aphrb167i8r3qa6w7ir673jhw, +1) already exists. CONTEXT: COPY reactions, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "channelmemberhistory_pkey" DETAIL: Key (channelid, userid, jointime)=(1111fjk9w78i8kggmt4tjhg11r, ero5b5m9otn4t8mbic9etncm8c, 1683087600044) already exists. CONTEXT: COPY channelmemberhistory, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "pluginkeyvaluestore_pkey" DETAIL: Key (pluginid, pkey)=(com.mattermost.apps, mmi_botid) already exists. CONTEXT: COPY pluginkeyvaluestore, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "drafts_pkey" DETAIL: Key (userid, channelid, rootid)=(1aphrb167i8r3qa6w7ir673jhw, j979xh5f1pftz8j7n6rd8o9z6a, qgq68ugj6tdguewigii1igxu3e) already exists. CONTEXT: COPY drafts, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "teammembers_pkey" DETAIL: Key (teamid, userid)=(1x7bdokmbpf5jrhxfrwzw95ooa, 41kdsohptib77n3tij8amh3mue) already exists. CONTEXT: COPY teammembers, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "fileinfo_pkey" DETAIL: Key (id)=(1x3yim76ebdsun7yq5oqhuc7fy) already exists. CONTEXT: COPY fileinfo, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "audits_pkey" DETAIL: Key (id)=(111kqhfrnt8gdjr7rqhzyh3why) already exists. CONTEXT: COPY audits, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "jobs_pkey" DETAIL: Key (id)=(1113e8guepg5uek7n47f4hedgh) already exists. CONTEXT: COPY jobs, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "channelmembers_pkey" DETAIL: Key (channelid, userid)=(1111fjk9w78i8kggmt4tjhg11r, ero5b5m9otn4t8mbic9etncm8c) already exists. CONTEXT: COPY channelmembers, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "postspriority_pkey" DETAIL: Key (postid)=(11cscw5dq7nfz86oj6u7guw14y) already exists. CONTEXT: COPY postspriority, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "sidebarcategories_pkey" DETAIL: Key (id)=(1ijsx95uoj8p3q3kep7nxh3j6r) already exists. CONTEXT: COPY sidebarcategories, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "status_pkey" DETAIL: Key (userid)=(1aphrb167i8r3qa6w7ir673jhw) already exists. CONTEXT: COPY status, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "bots_pkey" DETAIL: Key (userid)=(8bff8k1qr7b87msubggiuqxhne) already exists. CONTEXT: COPY bots, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "preferences_pkey" DETAIL: Key (userid, category, name)=(1aphrb167i8r3qa6w7ir673jhw, actions_menu, actions_menu_tutorial_state) already exists. CONTEXT: COPY preferences, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "threads_pkey" DETAIL: Key (postid)=(1113y88wm3fdmmw1kxt9gr1z3y) already exists. CONTEXT: COPY threads, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "sessions_pkey" DETAIL: Key (id)=(1e699b8i47gwtfuj3sifhwqpph) already exists. CONTEXT: COPY sessions, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "sidebarchannels_pkey" DETAIL: Key (channelid, userid, categoryid)=(1111fjk9w78i8kggmt4tjhg11r, ero5b5m9otn4t8mbic9etncm8c, 7u7yeijz4fnamewpy96po3orao) already exists. CONTEXT: COPY sidebarchannels, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "publicchannels_pkey" DETAIL: Key (id)=(15xfz3c69tddmmymb9wx4ksfcr) already exists. CONTEXT: COPY publicchannels, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "channels_pkey" DETAIL: Key (id)=(1111fjk9w78i8kggmt4tjhg11r) already exists. CONTEXT: COPY channels, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "productnoticeviewstate_pkey" DETAIL: Key (userid, noticeid)=(1aphrb167i8r3qa6w7ir673jhw, crt-admin-default_off) already exists. CONTEXT: COPY productnoticeviewstate, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "recentsearches_pkey" DETAIL: Key (userid, searchpointer)=(1aphrb167i8r3qa6w7ir673jhw, 0) already exists. CONTEXT: COPY recentsearches, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "postreminders_pkey" DETAIL: Key (postid, userid)=(59uax8g5efbemc8z1m89jr8wna, ero5b5m9otn4t8mbic9etncm8c) already exists. CONTEXT: COPY postreminders, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "linkmetadata_pkey" DETAIL: Key (hash)=(114770789) already exists. CONTEXT: COPY linkmetadata, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "users_pkey" DETAIL: Key (id)=(1aphrb167i8r3qa6w7ir673jhw) already exists. CONTEXT: COPY users, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "incomingwebhooks_pkey" DETAIL: Key (id)=(bepzrhds47dzxp3q87anqhmama) already exists. CONTEXT: COPY incomingwebhooks, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "roles_pkey" DETAIL: Key (id)=(18xcp4fpcpg4drwwirskcu33cw) already exists. CONTEXT: COPY roles, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "teams_pkey" DETAIL: Key (id)=(1x7bdokmbpf5jrhxfrwzw95ooa) already exists. CONTEXT: COPY teams, line 1 ERROR Database error 23505: duplicate key value violates unique constraint "posts_pkey" DETAIL: Key (id)=(11118p58dbn3ifsekfnz9k4zuy) already exists. CONTEXT: COPY posts, line 1 ERROR PostgreSQL Database error 42501: must be owner of database mattermost QUERY: ALTER DATABASE "mattermost" SET search_path TO mattermost;