Migrate to Railway
medaliorh
PROOP

a year ago

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 !! ,

Solved$30 Bounty

262 Replies

a year ago

Hey there Kennsey!

So to clarify, the main issue currently is connecting to the database right?


medaliorh
PROOP

a year ago

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


irazvan2745
FREE

a year ago

Hey, did you import the dump into the db?


medaliorh
PROOP

a year ago

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)


a year ago

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?


medaliorh
PROOP

a year ago

help me do that , so to do the things clean , should i start by creating a wordpress+MariaDb template or Wordpress+Mysql template


a year ago

What was your existing database? MySQL or MariaDB?


irazvan2745
FREE

a year ago

Install the mariadb/MySQL client on your computer and run this

mysql -h db.example.com -P 3306 -u -p 'my password here' mydb < dump.sql


irazvan2745
FREE

a year ago

Replace the dummy text


medaliorh
PROOP

a year ago

it should be just setting the code up in namecheap's server , since i cannot acces em files without using easyWP


medaliorh
PROOP

a year ago

i did try that but it ends up with timeout , maybe cause the wp_sump.sql file is 3.4GB


a year ago

Oh my


medaliorh
PROOP

a year ago

but sure let's try that again


a year ago

Around how long into the upload does it timeout?


irazvan2745
FREE

a year ago

Oh uhh


medaliorh
PROOP

a year ago

yeah and the files compressed are almost 28GB it's so fkin annoying , i fkin hate NoCode devs


a year ago

Yeah wild...


a year ago

_ _


medaliorh
PROOP

a year ago

is there a voice channel where i can share my screen ??


a year ago

Not quite sure there is here. Can you just try sharing screenshots?


medaliorh
PROOP

a year ago

i don't know exactly like almost 2 min


a year ago

So it does start uploading it just times out


a year ago

Can I see the actual error you get? As long as it doesnt have any sensitive information in it 😁


medaliorh
PROOP

a year ago

1412844128710164491


medaliorh
PROOP

a year ago

i'll go with this


medaliorh
PROOP

a year ago

nah i can't connect to the database either , i was trying to upload stuff part by parts


medaliorh
PROOP

a year ago

lemme show


a year ago

Oh so it fails to even start? Interesting


medaliorh
PROOP

a year ago

1412844649764098128


medaliorh
PROOP

a year ago

now, is there a way to conect to the database from shell ??


irazvan2745
FREE

a year ago

Mysql client


irazvan2745
FREE

a year ago

.


a year ago

You can!



medaliorh
PROOP

a year ago

looks like host is empty

1412845164665503835


a year ago

Have you done an initial deployment of that service?


a year ago

1412845356336812144


medaliorh
PROOP

a year ago

No , should i ? cause i want to dump the database anyways


a year ago

You should start up the database at least once to "create" it


a year ago

then once the service is running you should be able to railway connect to it and execute shell commands.


medaliorh
PROOP

a year ago

1412845841864986794


irazvan2745
FREE

a year ago

Click deploy on railway


a year ago

Have you done an initial deployment via the web?


medaliorh
PROOP

a year ago

1412846019586035772


a year ago

Hmmm, railway might have not refreshed yet? Maybe close and reopen it...


a year ago

it should show that off as it does have a volume


medaliorh
PROOP

a year ago

nop


irazvan2745
FREE

a year ago

Shouldn’t it have crashed if the env variables were wrong?


medaliorh
PROOP

a year ago

i've even tried to expose the database


a year ago

Can you link the template you are using? interested in trying myself


medaliorh
PROOP

a year ago

just go to template and search for wordpress , it's the most used one


medaliorh
PROOP

a year ago

wordpress+MariaDb


a year ago

checking 👍


medaliorh
PROOP

a year ago

should've created my own stuff instead of importing the templates ?


a year ago

Well, i dont think that theres that much of an issue using the template


a year ago

1412847196805660773


medaliorh
PROOP

a year ago

like having the stuff setup locally then try to upload them to railway ??


a year ago

So, I deployed and connected to the mariadb service


a year ago

and thats very interesting

1412847322735448226


a year ago

Let me try one more thing, I have a theory


medaliorh
PROOP

a year ago

wordpress works flawlessly tho


a year ago

That theory is, do you have the mysql client installed on your machine?


medaliorh
PROOP

a year ago

i feel like i'll be exporting stuff one by one !


medaliorh
PROOP

a year ago

i do


irazvan2745
FREE

a year ago

Do this then


medaliorh
PROOP

a year ago

but wut is the -h ?


a year ago

So Railway CLI looks like it doesnt recognize this MariaDB instance. Let's try via public endpoint


irazvan2745
FREE

a year ago

The host


medaliorh
PROOP

a year ago

oh should i use the wordpress one ?


medaliorh
PROOP

a year ago

1412848069321560105


a year ago

MariaDB doesn't seems to have a shell by default on $PATH so that's why railway connect fails as according to the docs (?)


a year ago

use the

1412848123440664636


a year ago

Well, mariaDB is also mysql compat


medaliorh
PROOP

a year ago

lemme try that


a year ago

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


medaliorh
PROOP

a year ago

there's a private host tho


a year ago

are you on windows or mac?


medaliorh
PROOP

a year ago

linux


a year ago

unix cli cool


medaliorh
PROOP

a year ago

parrot OS


a year ago

Trying a couple of configuration things real quick. Might be on to something


irazvan2745
FREE

a year ago

apt install mariadb-client


irazvan2745
FREE

a year ago

Or whatever your package manager is


irazvan2745
FREE

a year ago

Then run the command I sent but replace the dummy text


medaliorh
PROOP

a year ago

1412849841339498588


a year ago

That has your password in it, would suggest changing that for future ref 😁


a year ago

I'm testing out the wordpress + mysql template


medaliorh
PROOP

a year ago

idc ket's just make it work and i'll be building another project


irazvan2745
FREE

a year ago

Use the public endpoint


a year ago

if you dont have this set on your mariadb thing you should

1412850205161951242


medaliorh
PROOP

a year ago

so i'll setup a public endpoint once again right ?


a year ago

I think... Unsure how similar the settings for maria/mysql are compared to postgres (which i mainly use)


a year ago

This mysql template is looking promising


medaliorh
PROOP

a year ago

1412850558871670987


irazvan2745
FREE

a year ago

Also uhh, maybe change the password


a year ago

Its a dummy project rn he'll change it later


irazvan2745
FREE

a year ago

Ah alr


a year ago

Alright so!


a year ago

mysql client works on this mysql template


medaliorh
PROOP

a year ago

yeah i did


a year ago

1412850822785536000


a year ago

Was able to connect on this


medaliorh
PROOP

a year ago

if you have a template working just give me it at this point


irazvan2745
FREE

a year ago

It’s just what you’re using prob



a year ago

This is the template that I used.


a year ago

Looks like it has 100% success across 237 active projects

1412851070111187015


medaliorh
PROOP

a year ago

.


a year ago

Railway CLI also works over this

1412851241691779122


medaliorh
PROOP

a year ago

looks like i ecceded the limit does the deleted projects also counts ?

1412851249321218150


irazvan2745
FREE

a year ago

Delete the old one


a year ago

Nope! Just delete the old one or choose to add it to an existing project


a year ago

1412851448626020495


medaliorh
PROOP

a year ago

looks like i cant

1412851633666265178


a year ago

So you are unable to delete the existing project on the free plan?


medaliorh
PROOP

a year ago

i'm just gonna cancel deletion of this one

1412851782878629990


medaliorh
PROOP

a year ago

oh maybe delete permently


a year ago

I think they are scheduled deletions. 30 days of grace when you click that in case of misclick


medaliorh
PROOP

a year ago

allright it worked


irazvan2745
FREE

a year ago

Yeah


medaliorh
PROOP

a year ago

alright let's try with this

1412852150975070290


a year ago

So you can grab the connection URI from the MySQL variables


a year ago

1412852247364374538


irazvan2745
FREE

a year ago

That’s prob an internal one


a year ago

And connect with the native mysql client.

Or just railway link > choose project > choose env > select service


a year ago

it is not


irazvan2745
FREE

a year ago

Ah


a year ago

Then once you select the right project run railway connect and you should have access to the mysql console.


medaliorh
PROOP

a year ago

1412852475257426012


medaliorh
PROOP

a year ago

nice

1412852579703980183


medaliorh
PROOP

a year ago

now to dump


a year ago

There you go! Now dumping should work. Let me know how that looks


irazvan2745
FREE

a year ago

^^


a year ago

No need. railway connect does one for you


a year ago

Kennsey is currently in mysql shell as you can see here.


irazvan2745
FREE

a year ago

Doesn’t he want to import the dump?


a year ago

You can do so via that iirc


irazvan2745
FREE

a year ago

Pretty sure you can’t, that’s just a “terminal”, may be wrong


medaliorh
PROOP

a year ago

yes


medaliorh
PROOP

a year ago

i'm trying the railway run


medaliorh
PROOP

a year ago

do you have a better suggestion >?


irazvan2745
FREE

a year ago

Mariadb client


a year ago

we're now using mysql 😁


irazvan2745
FREE

a year ago

Or MySQL client


irazvan2745
FREE

a year ago

They are cross compatible


a year ago

mysql --protocol=TCP --connect-timeout=30 --ssl-mode=PREFERRED -h HOSTURL -P PORT -u root --password=PASSWORD railway &lt; ./path

should work


a year ago

Obviously replacing HOSTURL PORT and PASSWORD alongside ./path


a year ago

dumps are very annoying to backup and work with


a year ago

It'll probably warn "its not best to use pasword in cli!" but thats alright


medaliorh
PROOP

a year ago

i'm running this one and it's takin sometime

1412854642131599450


a year ago

Yeah I'd give it a good minute. Will take a bit


medaliorh
PROOP

a year ago

maybe it worked but the dump is heavy that's why


a year ago

Your command will finish running when its done.


medaliorh
PROOP

a year ago

hopefully it doean't timeout


a year ago

It shouldnt time out I don't think


medaliorh
PROOP

a year ago

1412855137726365716


medaliorh
PROOP

a year ago

i


medaliorh
PROOP

a year ago

i'll try urs


a year ago

Oh?


a year ago

yeah thats running over railway run <:Hmmmmm:891565000068587551>


irazvan2745
FREE

a year ago

id recommend using mysql cli, not railway run


a year ago

Thats what hes doing now 😁


medaliorh
PROOP

a year ago

mysql --protocol=TCP --connect-timeout=30 --ssl-mode=PREFERRED -h HOSTURL -P PORT -u root --password=PASSWORD railway < ./path


irazvan2745
FREE

a year ago

"railway run"


medaliorh
PROOP

a year ago

for this cmd should i setup a TCP ?


a year ago

It should be enabled already. If you look at settings > network


medaliorh
PROOP

a year ago

1412855678443454515


a year ago

so for me on the mySQL instance

1412855729764827167


a year ago

On this not the docker image

1412855792117223535


medaliorh
PROOP

a year ago

oh My bad i was on the docker image


a year ago

all good!


medaliorh
PROOP

a year ago

wut would u do on --ssl-mode=PREFERRED ?


a year ago

iirc thats just the plain mode 😂


irazvan2745
FREE

a year ago

its optional


a year ago

According to google: "enables encryption if available."


medaliorh
PROOP

a year ago

went with this

1412856831843500173


a year ago

Let me know how it goes


a year ago

Hows it looking?


medaliorh
PROOP

a year ago

still running


medaliorh
PROOP

a year ago

1412858166554661027


medaliorh
PROOP

a year ago

hmm looks like working


medaliorh
PROOP

a year ago

it's still running tho


a year ago

Great its uploading then!


medaliorh
PROOP

a year ago

about the other wordpress files how do you think i can import them ?


medaliorh
PROOP

a year ago

add me friend btw ❤️


a year ago

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


medaliorh
PROOP

a year ago

most of people just use plugins


medaliorh
PROOP

a year ago

but if just the database is sumped that's a huge progress for me


medaliorh
PROOP

a year ago

i owe u guys big time


a year ago

Yeah I sadly just dont know wordpress well enough to say "this is your answer for wordpress!"


a year ago

But for databases I live in those


medaliorh
PROOP

a year ago

idk what's wrong with that MariDB connections , is it too secure or wut ?


medaliorh
PROOP

a year ago

DW i hate wordpress 2 x)


a year ago

It might have just been a different service that railway didnt recognize as a standard "database"


a year ago

compared to mongo/pg/mysql


a year ago

which is funky but oh well!


a year ago

Is it still uploading the sql dump?


medaliorh
PROOP

a year ago

yes xD


medaliorh
PROOP

a year ago

should've added a checkpoint dot


a year ago

Okay cool! Well, is that all for this thread haha?


medaliorh
PROOP

a year ago

well we fixed my database connection for sure ,by using a different database x)


medaliorh
PROOP

a year ago

so yeah that's why i openned this thread


a year ago

Yeah thats still funky why the shell wasn't connecting on mariadb hmm. Something to remember


medaliorh
PROOP

a year ago

question


a year ago

Answer <:picassoface:1398147502598918144>


medaliorh
PROOP

a year ago

will i hit the max volume ?

1412861180296564896


a year ago

If you said your SQL dump was ~3g and your volume only has 500mb yes you will.


medaliorh
PROOP

a year ago

the dump file is 3g


medaliorh
PROOP

a year ago

but wait i should see that colume progress right ?


medaliorh
PROOP

a year ago

volume *


a year ago

Volume progress?


a year ago

Theres a pretty good chance you reach the max with a dump that large unless I'm missing something.


medaliorh
PROOP

a year ago

this should do the trick ?

1412861747643289651


a year ago

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.


medaliorh
PROOP

a year ago

wtf even is this website having a freaking 3gb database ! i fkin hate wordpress


a year ago

-# You and me both 😂


medaliorh
PROOP

a year ago

this is so not normal


medaliorh
PROOP

a year ago

the volume Usage doesn't progress tho i'm worried


medaliorh
PROOP

a year ago

if the dump file fails i'll have to clean the database and try again ?


a year ago

I believe so yes. I'm not sure if sql dumps resume or not.


a year ago

Or if they clear progress if fail


medaliorh
PROOP

a year ago

FReak !


medaliorh
PROOP

a year ago

i upgraded the size and it aboarted


a year ago

Checks out that it would do that 😁


medaliorh
PROOP

a year ago

hmm should i just run the command again , or do i have to clean the database


medaliorh
PROOP

a year ago

cause it's still full


a year ago

I'd clean and run again to be safe


medaliorh
PROOP

a year ago

wait


a year ago

waiting


medaliorh
PROOP

a year ago

maybe it failed for another reason


medaliorh
PROOP

a year ago

1412863459284095078


medaliorh
PROOP

a year ago

was it just a coincidnce ?


a year ago

I'd just delete and restart yeah.


medaliorh
PROOP

a year ago

naaah i don't think so , it's probably the resizing


medaliorh
PROOP

a year ago

wait i can't drop db


irazvan2745
FREE

a year ago

change the dump


irazvan2745
FREE

a year ago

so its the correct db name and such


medaliorh
PROOP

a year ago

yeah i just droped railways database and recreated it x)


medaliorh
PROOP

a year ago

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 ?


a year ago

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


a year ago

does that make sense?


medaliorh
PROOP

a year ago

Oh!


medaliorh
PROOP

a year ago

that's better then


medaliorh
PROOP

a year ago

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 ?


a year ago

I'm actually not too sure on that. This is a community bounty which means its open for the community to help


medaliorh
PROOP

a year ago

i guess there's progress here

1412865186506870904


medaliorh
PROOP

a year ago

already reaching 1GB unbelievable

1412865534688497724


medaliorh
PROOP

a year ago

wait i did select 5GB but it's written 32 GB


medaliorh
PROOP

a year ago

but as u said it doesn't matter how much i allocated , what matter is how much i'm using


a year ago

Yep! Usage based not allocation based


medaliorh
PROOP

a year ago

hoepfully the database dump would be enough for the whole website


medaliorh
PROOP

a year ago

because 3GB it gotta be populating the tables


medaliorh
PROOP

a year ago

ain't no way it's just the structure


medaliorh
PROOP

a year ago

4GB x)


medaliorh
PROOP

a year ago

@Error Do u mind adding me a friend , i really appreciate ur help ! ❤️


a year ago

Hey! My DMs are open but I've slowly stopped adding a bunch of people unless I need to. Nothing personal at all 😁


medaliorh
PROOP

a year ago

wohoo looks like it's finished 0.0


a year ago

Yay!


a year ago

Am I good to close out this thread?


medaliorh
PROOP

a year ago

fine then


a year ago

Happy to have helped <:picassoface:1398147502598918144>


Status changed to Solved noahd 12 months ago


a year ago

!s


Welcome!

Sign in to your Railway account to join the conversation.

Loading...