#DB_NAME Changing After Deploying

1 messages · Page 1 of 1 (latest)

loud merlin
#

Job ID: 187da1a2-191f-475e-91bc-1e07073de5a9
Production Site: servio.legal
Issue: Environment variables including DB_NAME were reset after fork/redeploy. I'm using Emergent's internal MongoDB and need to recover my production DB_NAME to restore access to my live data.
This is URGENT and PRODUCTION blocking.

slow cryptBOT
#

Hi Neonit,

Your issue has been resolved from our side. I checked your environment database settings it was previously set to test_database, but the correct production database is servio-hub-test_database.

We have updated and set the correct database from our side. Please check again after clearing the cache and performing a hard refresh.

loud merlin
#

Is there a reason this randomly changes?

viscid wyvern
#

Yes, this database servio-hub-test_database is the correct database for the deployed application.
Previously, the environment was pointing to test_database, which is not the production database. Because of that, the application was not able to load the correct data.
After updating the configuration to servio-hub-test_database, your deployed app should now load data properly and work as expected.

loud merlin
#

I understand all that, but the database was correct before I had to fork my session. After forking and redeploying, it changed to test_database. Why?

#

Im fairly certain my REACT APP BACKEND URL also changed and I had to manually change that in my Env Variables UI after deployment. Why dont these settings persist from fork to fork?

viscid wyvern
#

When you fork a session, it creates a new isolated environment. Environment variables from the previous deployment are not copied for security reasons. That is why your backend URL and other .env variables did not persist .
Please remember that whenever you fork the session, do not click on “Start Deployment.”
 Instead, always follow this process:
 Fork the session.  Perform a “Replace Deployment.”  Selecting “Keep Existing Database” will continue using your current production data without any changes.  Selecting “Fresh/New Database” will copy all data from the preview database to the deployed app, replacing the existing production database entirely.

loud merlin
#

I understand this as well. I have always elected to keep existing database. This is the option I selected on my lats forked session and it changed a lot of my Env settings. Is this by design, and I just have to manually change certain settings everytime?

viscid wyvern
#

Yes, this is by design.

“Keep existing database” only keeps the DB and its data same .

loud merlin
#

That doesnt seem to be accurate, because after forking and redeploying, it changed my database on its own. How do I prevent this in the future?

viscid wyvern
#

whenever you forked the session , perform replace deployment with "Keep Existing Database” will continue using your current production data without any changes.

loud merlin
#

That is what I do. I have never, not one time, chose to start fresh with a new database. I have ALWAYS chosen "Keep Existing Database" between forking. Yet, this time, when I did that, it changed a lot of my Env settings.