Inconsistent database names
jlew24asu
PROOP

2 years 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

2 years ago

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


2 years ago

did you use the sync feature?


jlew24asu
PROOP

2 years ago

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


jlew24asu
PROOP

2 years ago

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


2 years 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

2 years ago

@ChicagoPhotoShop you are talking with a bot


jlew24asu
PROOP

2 years ago

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


jlew24asu
PROOP

2 years ago

oh


2 years ago

beep boop


jlew24asu
PROOP

2 years ago

is brody sonnet 3.7? he good


2 years ago

thank you, feedback recorded


3.8 I hear


jlew24asu
PROOP

2 years ago

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


2 years ago

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


jlew24asu
PROOP

2 years ago

different code


2 years ago

you can choose the branch after the sync


jlew24asu
PROOP

2 years ago

ah


jlew24asu
PROOP

2 years ago

different URLs too. will those sync?


jlew24asu
PROOP

2 years ago

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


jlew24asu
PROOP

2 years ago

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


jlew24asu
PROOP

2 years 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

2 years ago

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


2 years ago

no you arent, and nothing is stopping you haha


2 years ago

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


jlew24asu
PROOP

2 years ago

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


2 years 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

2 years 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

2 years ago

now I have to go change my CNAME.


2 years ago

thats what all ive said achieves


jlew24asu
PROOP

2 years ago

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


2 years ago

trust


jlew24asu
PROOP

2 years 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

2 years 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.


2 years 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

2 years 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.


2 years ago

what environment has the funny names for the databases?


jlew24asu
PROOP

2 years 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


2 years ago

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


jlew24asu
PROOP

2 years ago

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


jlew24asu
PROOP

2 years ago

until I sync'ed from dev


2 years ago

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


jlew24asu
PROOP

2 years 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?


2 years ago

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


jlew24asu
PROOP

2 years ago

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


2 years ago

that alone doesn't change the name of the service


jlew24asu
PROOP

2 years ago

why not? what does?


2 years ago

creating another database of the same type


jlew24asu
PROOP

2 years 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.


2 years ago

because you deployed a database into dev manually instead of syncing


2 years ago

^


jlew24asu
PROOP

2 years 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.


2 years ago

the envs are supposed to be synced


jlew24asu
PROOP

2 years ago

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


2 years ago

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


jlew24asu
PROOP

2 years 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

2 years ago

both in same project


jlew24asu
PROOP

2 years ago

I dont want foo and foo123 to be synced


2 years ago

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


jlew24asu
PROOP

2 years 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.


2 years ago

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


jlew24asu
PROOP

2 years ago

remove stuff?

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


2 years ago

we do not sync the data in the database


jlew24asu
PROOP

2 years ago

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


2 years ago

!s


Status changed to Solved brody • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...