3 months ago
Hello Railway's team,
I am unable to transfer the data between those two because I cannot Enable External Database Access, could you please assist me what that as I will have to do it on both of my projects
Pinned Solution
3 months ago
You don’t actually need an “Enable External Database Access” switch for this – that was the old model. On the current Railway setup you use TCP Proxy / DATABASE_PUBLIC_URL to reach the DB from outside, and then do a normal Postgres → MySQL migration.
A simple way to do it:
In your Postgres service, go to Settings → Networking → TCP Proxy, enable it and note the public host/port (or just copy DATABASE_PUBLIC_URL / PG* vars from the Variables tab).
Do the same for your MySQL service (so you have a host, port, user, password, and DB name for both).
From your own machine (or a one-off container) export from Postgres and import into MySQL. One straightforward option is CSV per table:
# 1) Export from Postgres
psql "$POSTGRES_URL" -c "\COPY my_table TO 'my_table.csv' WITH CSV HEADER"
# 2) Import into MySQL
mysql --host=... --port=... --user=... --password=... mydb \
-e "LOAD DATA LOCAL INFILE 'my_table.csv'
INTO TABLE my_table
FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES;"
Repeat for each table, or use a migration tool that can read from Postgres and write to MySQL if you’d rather not deal with CSV manually.
So the missing piece isn’t a special Railway feature – it’s just:
enable TCP Proxy / use the public URLs for both DBs
then run a standard Postgres → MySQL migration from outside using those connection details.
3 Replies
3 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
3 months ago
not resolved I'm trying to extract it from postgrade and import it in MySQL
3 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open ray-chen • 3 months ago
3 months ago
You don’t actually need an “Enable External Database Access” switch for this – that was the old model. On the current Railway setup you use TCP Proxy / DATABASE_PUBLIC_URL to reach the DB from outside, and then do a normal Postgres → MySQL migration.
A simple way to do it:
In your Postgres service, go to Settings → Networking → TCP Proxy, enable it and note the public host/port (or just copy DATABASE_PUBLIC_URL / PG* vars from the Variables tab).
Do the same for your MySQL service (so you have a host, port, user, password, and DB name for both).
From your own machine (or a one-off container) export from Postgres and import into MySQL. One straightforward option is CSV per table:
# 1) Export from Postgres
psql "$POSTGRES_URL" -c "\COPY my_table TO 'my_table.csv' WITH CSV HEADER"
# 2) Import into MySQL
mysql --host=... --port=... --user=... --password=... mydb \
-e "LOAD DATA LOCAL INFILE 'my_table.csv'
INTO TABLE my_table
FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES;"
Repeat for each table, or use a migration tool that can read from Postgres and write to MySQL if you’d rather not deal with CSV manually.
So the missing piece isn’t a special Railway feature – it’s just:
enable TCP Proxy / use the public URLs for both DBs
then run a standard Postgres → MySQL migration from outside using those connection details.
Status changed to Solved ray-chen • 3 months ago