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.
64 Replies
a year ago
did you use the sync feature?
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.
a year ago
beep boop
a year ago
thank you, feedback recorded
a year ago
3.8 I hear
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?
a year ago
you can choose the branch after the sync
my backend is api-dev.mydomain. prod is api.mydomain. frontend URLs are different too
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
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
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
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.
a year ago
thats what all ive said achieves
a year ago
trust
maybe I'm doing this all wrong. what is the best practice? have one railway env and just flip back and forth between branches?
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
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?
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
a year ago
I can't keep track of what you've done haha
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
a year ago
that alone doesn't change the name of the service
a year ago
creating another database of the same type
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
^
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
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
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
a year ago
you want an environment, just don't sync what you don't want
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
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
a year ago
!s
Status changed to Solved brody • about 1 year ago