Plugin -> Database Service migration resulted in unlinked Preview Environment variables
We went through the 1-Click Plugin to Service migration for our Redis database that we saw in the recent notice.
Our production service had the service variables inside it auto-updated by the migration flow, but they are now unlinked when we create preview environments.
When I say "unlinked", I'm not sure if that's the right word, but it looks like they are hard coded into our
production
env's other service now instead of magically linked to Redis like they used to be (see screenshot #1). We have our project setup to fork from the production
environment and not isolate changes between other environments (see screenshot #2).
In preview environments, I am seeing no variables on the new Redis service.
My question is, with new Database Services should I be creating new shared environment variables? Should those have been created automatically? I found some steps in the Redis migration template here (https://github.com/railwayapp-templates/redis-plugin-migration/blob/864b51a946aea908b85f7c1acd2b6e8fb155df31/migrate.sh#L113C1-L116) but wonder if I'm missing something obvious.
Project ID: 1d3ab213-7e4f-45f6-a136-1326d80d0606
I appreciate any help πGitHub
redis-plugin-migration/migrate.sh at 864b51a946aea908b85f7c1acd2b6e...
Contribute to railwayapp-templates/redis-plugin-migration development by creating an account on GitHub.
7 Replies
Project ID:
1d3ab213-7e4f-45f6-a136-1326d80d0606
For more context, here's my preview env's redis service with no variables in it. When I compare that to the prod service it does have some variables that were set properly.
The preview environment was created after the migration took place a few days ago.
When I open up the API server variables in the preview env, I see the Redis Legacy variables visible as shared references, but I do not see any auto-generated Redis variables from the newer Redis database service.
Hey Kyle,
Since databases are now just regular services, the variables are not automatically populated in a new environment. This is why you don't see them in the PR environment.
To get around this you can tick "Isolate changes..." which will copy the variables from the base environment when creating the PR env
We are very aware that this flow is not great and are working on a bunch of improvements to environments that will make this much smoother
Thanks jr, we'll try the isolate changes option as a workaround for the time being.
I expected I might see some variables on the Redis service though, does that mean that the exact same variables from the prod environment remain the same on each new preview environment's service? (same password, same host, etc?..) I guess I assumed maybe those variables were changing.
Just tried the isolate changes options and that worked to make sure we got the variables on new preview environments. We'll look forward to other changes but that does help us keep our same workflow, thank you!
The password will be the same yes. The host and port are reference variables and will be point to the correct database in the environment.