Inconsistent database names
jlew24asu
PROOP

a year ago

I have two ENVs in railway. prod/dev. In dev, everything is working and I noticed my db services have different names vs prod.

in dev I have

MySQL-xmbe

Redis-YDIX

in my prod end, I dont its just

MySQL

Redis

maybe its nothing, but I'm having the hardest time deploying to prod and trying to find all differences.

Solved

64 Replies

jlew24asu
PROOP

a year ago

bd013fab-cb05-4c28-94e5-0edac196d6b


a year ago

did you use the sync feature?


jlew24asu
PROOP

a year ago

no. but I see it. asking if I want to sync from dev.


jlew24asu
PROOP

a year ago

prod/dev use different git branches. what am I sync'ing exactly?


a year ago

so thats what happened, you manually recreated everything in the other environment instead of using sync.

services across all environments need to have unique names so we tacked on the random string, but if you use the sync feature we will sync the services across the environment so that they keep the same name.


cojoclaudiu
HOBBY

a year ago

@ChicagoPhotoShop you are talking with a bot


jlew24asu
PROOP

a year ago

ok. I'm happy to sync sql/redis, but not the backend/frontend services


jlew24asu
PROOP

a year ago

oh


a year ago

beep boop


jlew24asu
PROOP

a year ago

is brody sonnet 3.7? he good


a year ago

thank you, feedback recorded


3.8 I hear


jlew24asu
PROOP

a year ago

so anyway. do I want to sync? happy to sync sql/redis but frontend/backend services are different branches


a year ago

may i ask you to share why you wouldn't want to sync the backend and frontend services?


jlew24asu
PROOP

a year ago

different code


a year ago

you can choose the branch after the sync


jlew24asu
PROOP

a year ago

ah


jlew24asu
PROOP

a year ago

different URLs too. will those sync?


jlew24asu
PROOP

a year ago

my backend is api-dev.mydomain. prod is api.mydomain. frontend URLs are different too


jlew24asu
PROOP

a year ago

am I the first person who wants to setup completely separate envs?


jlew24asu
PROOP

a year ago

ok this doesnt seem right at all. I dont want to sync. I just want working DBs in each env. with different URLs. both working from different branches


jlew24asu
PROOP

a year ago

what does it mean that MySQL and Redis doesnt have -foo names?


a year ago

no you arent, and nothing is stopping you haha


a year ago

you want to sync, just change the url after the fact and it will stay like that


jlew24asu
PROOP

a year ago

ok. but just so I understand. why isnt my prod env creating its own DB/redis? why am I being forced to sync?


a year ago

you already created the prod db and redis, you want to delete the services in the dev env, and then sync the prod env into dev


jlew24asu
PROOP

a year ago

yea, but I dont. I want both. I want a dev env, with a copy of the db that I dont care if its breaks, on a separate branch from main. and I want a prod env, connected to main, and a copy of the db that doesnt get messed with.


jlew24asu
PROOP

a year ago

now I have to go change my CNAME.


a year ago

thats what all ive said achieves


jlew24asu
PROOP

a year ago

you've been downgraded to 3.5. but I'll do it.


a year ago

trust


jlew24asu
PROOP

a year ago

maybe I'm doing this all wrong. what is the best practice? have one railway env and just flip back and forth between branches?


jlew24asu
PROOP

a year ago

actually no, thats difficult. I have different URLs as well. maybe I just abandon that and use same urls, and just different branches to test.


a year ago

two environments, a production and a testing, but do not manually create services, either duplicate the production environment or sync from production


jlew24asu
PROOP

a year ago

my problem is I'm backwards. I got dev working but not prod. 😄 but I'm starting to get the hang of railway envs now.


a year ago

what environment has the funny names for the databases?


jlew24asu
PROOP

a year ago

well they both do now after sync'ing. but I didnt really want to do that because I had already made small changes to the dev DB, that I didnt really care to have in prod.

I made a new prod env, and copied my DB from a VPS server (the original home of my db). but it never got the -foo names, which lead to this thread. but I've since sync'ed from dev, so now its fine I guess


a year ago

well then looks like you got yourself into a bit of a pickle


jlew24asu
PROOP

a year ago

yea no kidding. I just dont understand why my prod env never got -foo names


jlew24asu
PROOP

a year ago

until I sync'ed from dev


a year ago

I can't keep track of what you've done haha


jlew24asu
PROOP

a year ago

you and me both. I've given up trying to make a prod env. my dev env works, so I'm making this prod. from here I just wanted to know the best practice.

In my mind, I thought I'd make a new env from scatch, but apparently that doesnt work.

but again, can you just answer this question....

when I made a new SQL service in the prod env, and copied the data from my VPS (the data tab confirmed the data was there), why did I not have mysql-foo name?


a year ago

I don't know what you've done to reach that point, sorry


jlew24asu
PROOP

a year ago

I just told you? I made a MySql service and copied the data from my VPS


a year ago

that alone doesn't change the name of the service


jlew24asu
PROOP

a year ago

why not? what does?


a year ago

creating another database of the same type


jlew24asu
PROOP

a year ago

but thats exactly what I did. go back to the first message

n dev I have

MySQL-xmbe

Redis-YDIX

in my prod end, I dont its just

MySQL

Redis

on all 4 of these services, the data tab was exactly the same. only difference is the name.


a year ago

because you deployed a database into dev manually instead of syncing


a year ago

^


jlew24asu
PROOP

a year ago

thats what I dont understand. why is creating a database service manually the problem. this ENV shouldnt care or depend about any other env. I expecting it to be completely dependent of other envs. as if I was doing it for the first time.


a year ago

the envs are supposed to be synced


jlew24asu
PROOP

a year ago

ok, thats what I didnt know. so to do what I'm explaining, I would need a separate project.


a year ago

no, you want an environment, you just have to sync instead of manually creating duplicate services yourself


jlew24asu
PROOP

a year ago

but thats not what I want.

just as an example.....

prod env

backend service from main branch

frontend service from main branch

sql service point to DB foo

dev env

backend service from dev branch

frontend service from dev branch

sql service point to FB foo123


jlew24asu
PROOP

a year ago

both in same project


jlew24asu
PROOP

a year ago

I dont want foo and foo123 to be synced


a year ago

you want an environment, just don't sync what you don't want


jlew24asu
PROOP

a year ago

I'll take it a step further...

prod env

backend service from main branch api.mydomain.com

frontend service from main branch mydomain.com

sql service point to DB foo

dev env

backend service from dev branch api_dev.mydomain

frontend service from dev branch railway.app i dont care what this is.

sql service point to FB foo123

both in same project

just don't sync what you don't want

lol what? you keep telling me I have to sync. and from what I can see, sync is an all or none thing.


a year ago

at first it is, but you can remove stuff after the fact


jlew24asu
PROOP

a year ago

remove stuff?

ok, how do I remove tables that were in foo123 that are now synced to foo(prod)?


a year ago

we do not sync the data in the database


jlew24asu
PROOP

a year ago

lol oh. maybe I dont know what sync means then. I'll add it to the list.


a year ago

!s


Status changed to Solved brody about 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...