Hello , i have a worpress project which i used to host on Namecheap , but now i wanna migrate to railway , i did downlod the backup files and i have a Wp_dump.sql file , icreated a new Project using a template for worpress+MariaDb, i also installed and connected railway to my computer terminal , i've been trying for a while to connect to that database and dump the file but i just keep hitting connection errors , i've even opened a public Domain , and yet i can't connect to the database ! please any helpers !! ,
#Migrate to Railway
262 messages · Page 1 of 1 (latest)
Hey there Kennsey!
So to clarify, the main issue currently is connecting to the database right?
hi , yes i've been into that issue , but i just deleted everything and i'm trying once again with Mysql , just to explain , my objectif is to migrate to railway to host my projects ,and stop using namecheap , but there's a wordpress project (who isn't mine) that i want to also host in railway , this way i only have one host, so my objectif is to take that worpress project and dump its database and its content into railway to host it
Hey, did you import the dump into the db?
on namecheap , they used easyWP , i just downloaded a backup of the project and ended up with 2 compressed files , files(which are the wordpress files ) and database (which is a wp_sump.sql)
Okay that clears it up wonderful!
What's your current method of hosting the Wordpress site? Are you using an official image or just setting the code up?
help me do that , so to do the things clean , should i start by creating a wordpress+MariaDb template or Wordpress+Mysql template
What was your existing database? MySQL or MariaDB?
Install the mariadb/MySQL client on your computer and run this
mysql -h db.example.com -P 3306 -u <user> -p 'my password here' mydb < dump.sql
Replace the dummy text
it should be just setting the code up in namecheap's server , since i cannot acces em files without using easyWP
i did try that but it ends up with timeout , maybe cause the wp_sump.sql file is 3.4GB
Oh my
but sure let's try that again
Around how long into the upload does it timeout?
Oh uhh
yeah and the files compressed are almost 28GB it's so fkin annoying , i fkin hate NoCode devs
Yeah wild...
_ _
is there a voice channel where i can share my screen ??
Not quite sure there is here. Can you just try sharing screenshots?
i don't know exactly like almost 2 min
So it does start uploading it just times out
Can I see the actual error you get? As long as it doesnt have any sensitive information in it 😁
nah i can't connect to the database either , i was trying to upload stuff part by parts
lemme show
Oh so it fails to even start? Interesting
Mysql client
.
You can!
With Railway connect https://docs.railway.com/reference/cli-api#connect
looks like host is empty
Have you done an initial deployment of that service?
No , should i ? cause i want to dump the database anyways
You should start up the database at least once to "create" it
then once the service is running you should be able to railway connect to it and execute shell commands.
Click deploy on railway
Have you done an initial deployment via the web?
Hmmm, railway might have not refreshed yet? Maybe close and reopen it...
it should show that off as it does have a volume
nop
Shouldn’t it have crashed if the env variables were wrong?
i've even tried to expose the database
Can you link the template you are using? interested in trying myself
just go to template and search for wordpress , it's the most used one
wordpress+MariaDb
checking 👍
should've created my own stuff instead of importing the templates ?
like having the stuff setup locally then try to upload them to railway ??
So, I deployed and connected to the mariadb service
and thats very interesting
Let me try one more thing, I have a theory
wordpress works flawlessly tho
That theory is, do you have the mysql client installed on your machine?
i feel like i'll be exporting stuff one by one !
i do
Do this then
but wut is the -h ?
So Railway CLI looks like it doesnt recognize this MariaDB instance. Let's try via public endpoint
The host
MariaDB doesn't seems to have a shell by default on $PATH so that's why railway connect fails as according to the docs (?)
use the
Well, mariaDB is also mysql compat
lemme try that
I might actually be wrong on this. If maria and mysql are cross compat it might be interesting to try a template with mysql instead of mariadb
there's a private host tho
are you on windows or mac?
linux
unix cli cool
parrot OS
Trying a couple of configuration things real quick. Might be on to something
apt install mariadb-client
Or whatever your package manager is
Then run the command I sent but replace the dummy text
That has your password in it, would suggest changing that for future ref 😁
I'm testing out the wordpress + mysql template
idc ket's just make it work and i'll be building another project
Use the public endpoint
if you dont have this set on your mariadb thing you should
so i'll setup a public endpoint once again right ?
I think... Unsure how similar the settings for maria/mysql are compared to postgres (which i mainly use)
This mysql template is looking promising
Also uhh, maybe change the password
Its a dummy project rn he'll change it later
Ah alr
yeah i did
if you have a template working just give me it at this point
It’s just what you’re using prob
This is the template that I used.
Looks like it has 100% success across 237 active projects
.
Railway CLI also works over this
looks like i ecceded the limit does the deleted projects also counts ?
Delete the old one
Nope! Just delete the old one or choose to add it to an existing project
looks like i cant
So you are unable to delete the existing project on the free plan?
I think they are scheduled deletions. 30 days of grace when you click that in case of misclick
allright it worked
Yeah
alright let's try with this
That’s prob an internal one
And connect with the native mysql client.
Or just railway link > choose project > choose env > select service
it is not
Ah
Then once you select the right project run railway connect and you should have access to the mysql console.
There you go! Now dumping should work. Let me know how that looks
^^
No need. railway connect does one for you
Kennsey is currently in mysql shell as you can see here.
Doesn’t he want to import the dump?
You can do so via that iirc
Pretty sure you can’t, that’s just a “terminal”, may be wrong
yes
i'm trying the railway run
do you have a better suggestion >?
Mariadb client
we're now using mysql 😁
mysql --protocol=TCP --connect-timeout=30 --ssl-mode=PREFERRED -h HOSTURL -P PORT -u root --password=PASSWORD railway < ./path
should work
Obviously replacing HOSTURL PORT and PASSWORD alongside ./path
dumps are very annoying to backup and work with
It'll probably warn "its not best to use pasword in cli!" but thats alright
i'm running this one and it's takin sometime
Yeah I'd give it a good minute. Will take a bit
maybe it worked but the dump is heavy that's why
Your command will finish running when its done.
hopefully it doean't timeout
It shouldnt time out I don't think
id recommend using mysql cli, not railway run
Thats what hes doing now 😁
mysql --protocol=TCP --connect-timeout=30 --ssl-mode=PREFERRED -h HOSTURL -P PORT -u root --password=PASSWORD railway < ./path
"railway run"
for this cmd should i setup a TCP ?
It should be enabled already. If you look at settings > network
oh My bad i was on the docker image
all good!
wut would u do on --ssl-mode=PREFERRED ?
iirc thats just the plain mode 😂
its optional
According to google: "enables encryption if available."
went with this
Let me know how it goes
Hows it looking?
Great its uploading then!
about the other wordpress files how do you think i can import them ?
add me friend btw ❤️
Well. I am unfortunately not as familiar with wordpress as I'd like to be. I can give it a peek and see what others have done
most of people just use plugins
but if just the database is sumped that's a huge progress for me
i owe u guys big time
Yeah I sadly just dont know wordpress well enough to say "this is your answer for wordpress!"
But for databases I live in those
idk what's wrong with that MariDB connections , is it too secure or wut ?
DW i hate wordpress 2 x)
It might have just been a different service that railway didnt recognize as a standard "database"
compared to mongo/pg/mysql
which is funky but oh well!
Is it still uploading the sql dump?
Okay cool! Well, is that all for this thread haha?
well we fixed my database connection for sure ,by using a different database x)
so yeah that's why i openned this thread
Yeah thats still funky why the shell wasn't connecting on mariadb hmm. Something to remember
question
Answer 
will i hit the max volume ?
If you said your SQL dump was ~3g and your volume only has 500mb yes you will.
Volume progress?
Theres a pretty good chance you reach the max with a dump that large unless I'm missing something.
this should do the trick ?
It sure should! Thats the plan I currently have.
If you really need more data (then what the pro plan provides) you can create another thread and we can talk to the team about expanding volume size.
wtf even is this website having a freaking 3gb database ! i fkin hate wordpress
-# You and me both 😂
this is so not normal
the volume Usage doesn't progress tho i'm worried
if the dump file fails i'll have to clean the database and try again ?
I believe so yes. I'm not sure if sql dumps resume or not.
Or if they clear progress if fail
Checks out that it would do that 😁
hmm should i just run the command again , or do i have to clean the database
cause it's still full
I'd clean and run again to be safe
wait
waiting
I'd just delete and restart yeah.
yeah i just droped railways database and recreated it x)
i give 5gb to the database , now if i don't reach the 5GB and for instance it's just 900MB i can downsize it right ?
You can but I'd suggest giving it some padding in case it somehow goes over.
When you allocate 5g it doesnt remove a flat 5g from your available storage. If your actual data only takes 900mb it only costs 900mb worth
does that make sense?
Oh!
that's better then
i've got a proplan now
@Pro Plan - This role is for any member of a Team building their awesome product on Railway. Company? We help you with migrations from cloud platforms of varying sorts.
i should be able to get a support who will help me through all the migartion right ?
I'm actually not too sure on that. This is a community bounty which means its open for the community to help
i guess there's progress here
already reaching 1GB unbelievable
wait i did select 5GB but it's written 32 GB
but as u said it doesn't matter how much i allocated , what matter is how much i'm using
Yep! Usage based not allocation based
hoepfully the database dump would be enough for the whole website
because 3GB it gotta be populating the tables
ain't no way it's just the structure
4GB x)
@dire girder Do u mind adding me a friend , i really appreciate ur help ! ❤️
Hey! My DMs are open but I've slowly stopped adding a bunch of people unless I need to. Nothing personal at all 😁
wohoo looks like it's finished 0.0
fine then
Happy to have helped 
