#Migrate to Railway

262 messages · Page 1 of 1 (latest)

noble rain
#

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

dire girder
noble rain
#

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

untold badge
#

Hey, did you import the dump into the db?

noble rain
#

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)

dire girder
noble rain
dire girder
untold badge
#

Replace the dummy text

noble rain
noble rain
dire girder
#

Oh my

noble rain
#

but sure let's try that again

dire girder
#

Around how long into the upload does it timeout?

untold badge
#

Oh uhh

noble rain
#

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

dire girder
#

Yeah wild...

noble rain
#

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

dire girder
#

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

noble rain
dire girder
#

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 😁

noble rain
#

i'll go with this

noble rain
#

lemme show

dire girder
#

Oh so it fails to even start? Interesting

noble rain
#

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

dire girder
noble rain
#

looks like host is empty

dire girder
#

Have you done an initial deployment of that service?

noble rain
#

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

dire girder
#

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.

noble rain
untold badge
#

Click deploy on railway

dire girder
#

Have you done an initial deployment via the web?

noble rain
dire girder
#

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

#

it should show that off as it does have a volume

untold badge
# noble rain

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

noble rain
#

i've even tried to expose the database

dire girder
#

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

noble rain
#

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

#

wordpress+MariaDb

dire girder
#

checking 👍

noble rain
#

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

dire girder
#

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

noble rain
#

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

dire girder
#

So, I deployed and connected to the mariadb service

#

and thats very interesting

#

Let me try one more thing, I have a theory

noble rain
#

wordpress works flawlessly tho

dire girder
#

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

noble rain
#

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

noble rain
#

but wut is the -h ?

dire girder
#

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

untold badge
noble rain
#

oh should i use the wordpress one ?

violet dust
dire girder
#

use the

dire girder
noble rain
dire girder
#

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

noble rain
#

there's a private host tho

dire girder
#

are you on windows or mac?

noble rain
#

linux

dire girder
#

unix cli cool

noble rain
#

parrot OS

dire girder
#

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

untold badge
#

Or whatever your package manager is

#

Then run the command I sent but replace the dummy text

noble rain
dire girder
#

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

#

I'm testing out the wordpress + mysql template

noble rain
untold badge
dire girder
#

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

noble rain
#

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

dire girder
#

This mysql template is looking promising

noble rain
untold badge
#

Also uhh, maybe change the password

dire girder
#

Its a dummy project rn he'll change it later

untold badge
#

Ah alr

dire girder
#

Alright so!

#

mysql client works on this mysql template

noble rain
#

yeah i did

dire girder
#

Was able to connect on this

noble rain
untold badge
dire girder
dire girder
#

Looks like it has 100% success across 237 active projects

noble rain
#

.

dire girder
#

Railway CLI also works over this

noble rain
#

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

dire girder
noble rain
#

looks like i cant

dire girder
#

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

noble rain
#

i'm just gonna cancel deletion of this one

#

oh maybe delete permently

dire girder
#

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

noble rain
#

allright it worked

untold badge
noble rain
#

alright let's try with this

dire girder
#

So you can grab the connection URI from the MySQL variables

untold badge
dire girder
#

And connect with the native mysql client.
Or just railway link > choose project > choose env > select service

dire girder
untold badge
#

Ah

dire girder
#

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

noble rain
#

now to dump

dire girder
#

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

dire girder
#

No need. railway connect does one for you

dire girder
untold badge
#

Doesn’t he want to import the dump?

dire girder
#

You can do so via that iirc

untold badge
#

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

noble rain
#

i'm trying the railway run

#

do you have a better suggestion >?

untold badge
#

Mariadb client

dire girder
#

we're now using mysql 😁

untold badge
#

Or MySQL client

#

They are cross compatible

dire girder
#
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

noble rain
#

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

dire girder
#

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

noble rain
#

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

dire girder
noble rain
#

hopefully it doean't timeout

dire girder
#

It shouldnt time out I don't think

noble rain
#

i

#

i'll try urs

dire girder
#

Oh?

#

yeah thats running over railway run Hmmmmm

untold badge
dire girder
#

Thats what hes doing now 😁

noble rain
#

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

untold badge
noble rain
#

for this cmd should i setup a TCP ?

dire girder
#

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

noble rain
dire girder
#

so for me on the mySQL instance

#

On this not the docker image

noble rain
#

oh My bad i was on the docker image

dire girder
#

all good!

noble rain
#

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

dire girder
#

iirc thats just the plain mode 😂

untold badge
dire girder
#

According to google: "enables encryption if available."

noble rain
#

went with this

dire girder
#

Let me know how it goes

dire girder
noble rain
#

still running

#

hmm looks like working

#

it's still running tho

dire girder
#

Great its uploading then!

noble rain
#

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

#

add me friend btw ❤️

dire girder
#

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

noble rain
#

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

#

i owe u guys big time

dire girder
#

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

#

But for databases I live in those

noble rain
#

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

dire girder
#

compared to mongo/pg/mysql

#

which is funky but oh well!

#

Is it still uploading the sql dump?

noble rain
#

yes xD

#

should've added a checkpoint dot

dire girder
#

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

noble rain
#

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

#

so yeah that's why i openned this thread

dire girder
#

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

noble rain
#

question

dire girder
#

Answer picassoface

noble rain
#

will i hit the max volume ?

dire girder
#

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

noble rain
#

the dump file is 3g

#

but wait i should see that colume progress right ?

#

volume *

dire girder
#

Volume progress?

#

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

noble rain
#

this should do the trick ?

dire girder
#

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.

noble rain
#

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

dire girder
#

-# You and me both 😂

noble rain
#

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 ?

dire girder
#

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

#

Or if they clear progress if fail

noble rain
#

FReak !

#

i upgraded the size and it aboarted

dire girder
#

Checks out that it would do that 😁

noble rain
#

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

#

cause it's still full

dire girder
#

I'd clean and run again to be safe

noble rain
#

wait

dire girder
#

waiting

noble rain
#

maybe it failed for another reason

#

was it just a coincidnce ?

dire girder
#

I'd just delete and restart yeah.

noble rain
#

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

#

wait i can't drop db

untold badge
#

change the dump

#

so its the correct db name and such

noble rain
#

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 ?

dire girder
#

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?

noble rain
#

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 ?

dire girder
#

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

noble rain
#

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

dire girder
#

Yep! Usage based not allocation based

noble rain
#

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 ! ❤️

dire girder
#

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

noble rain
#

wohoo looks like it's finished 0.0

dire girder
#

Yay!

#

Am I good to close out this thread?

noble rain
#

fine then

dire girder
#

Happy to have helped picassoface