molul
molul
RRailway
Created by molul on 12/9/2023 in #✋|help
How to create a database backup on a Strapi deployment?
d70c5129-c831-4fe9-a30b-e5fab5259999
5 replies
RRailway
Created by molul on 2/22/2023 in #✋|help
Postgres database back: is it actually possible?
Project ID: c246c13a-79bc-4762-ae68-cb6f28ea0122
6 replies
RRailway
Created by molul on 12/31/2022 in #✋|help
strapi project deletes all data and config on every deploy
Ok, I finally understood everything and all is finally working. First, everytime you change anything regarding environment variables, all data and config will be wiped. But not when you add a new data model. That's a relief. Second, mixing tutorials is not good. Continuing from the previous message, I deleted ./env/production/server.js, as it wasn't ignored. It was just a matter of setting ./config/server.js like this: module.exports = () => ({ host: env('HOST'), port: env.int('PORT'), url: env('BACKEND_URL'), }) And then have BACKEND_URL as http://localhost:1337/ in my .env variable for development (.env is not being tracked in github) and as my Railway URL in Railway.
18 replies
RRailway
Created by molul on 12/31/2022 in #✋|help
strapi project deletes all data and config on every deploy
So the question would be: how is it getting ./config/server.js and not ./node/production/server.js, when I'm using NODE_ENV=production?
18 replies
RRailway
Created by molul on 12/31/2022 in #✋|help
strapi project deletes all data and config on every deploy
Ok, I'm starting to see things but I'm still confused. I think the Strapi deploy in Railway is still connected to the sqlite and not to the postgres database I created. I'll try to explain. No need to read this now, but I followed this tutorial and other guides in strapi forums and docs: https://dev.to/yinks/how-to-create-and-deploy-a-strapi-project-on-railway-3kja The important things: -I added NODE_ENV=production, BACKEND_URL=<<the railway Strapi deploy URL>> and BACKEND_URL_LOCAL=http://localhost:1337 to the Strapi .env file (which is added to .gtignore so it's not pushed -I added the three variables to Railway deploy variables -I edited ./config/server.js like this: module.exports = ({ env }) => ({ host: env('HOST', '0.0.0.0'), port: env.int('PORT', 1337), url: env('BACKEND_URL_LOCAL'), app: { keys: env.array('APP_KEYS'), }, }); -I created the directory "env/production" and then added a file "database.js" with the Postgres database info, and also a file "server.js" with this content: module.exports = () => ({ host: env('HOST'), port: env.int('PORT'), url: env('BACKEND_URL'), }) Now, if I start my local Strapi project with this command: ENV_PATH=./.env.production NODE_ENV=production npm run start When it's done, I get this info: "To manage your project 🚀, go to the administration panel at: http://localhost:1337/admin" I would expect to get "To manage your project 🚀, go to the administration panel at: <<my railway strapi URL>>/admin" So, as I'm getting localhost:1337 and not "my strapi URL", I guess it's using the ./config/server.js file (the local one) and not ./env/production/server.js. I confirmed that by changing the ./config/server.js to this: module.exports = ({ env }) => ({ host: env('HOST', '0.0.0.0'), port: env.int('PORT', 1337), url: env('BACKEND_URL'), app: { keys: env.array('APP_KEYS'), }, }); In this case, when I run Strapi, I'm being told to go to my Railway Strapi URL
18 replies
RRailway
Created by molul on 12/31/2022 in #✋|help
strapi project deletes all data and config on every deploy
Actually, the things I pushed so far were environment variables changes, not new collections or whatever, so I guess it makes sense strapi was fully rebuilt. The changes I pushed were to try to have the confirmation email link working properly, which I haven't yet achieved. Will try a few things tomorrow and get back Happy 2023, by the way! 🙂
18 replies
RRailway
Created by molul on 12/31/2022 in #✋|help
strapi project deletes all data and config on every deploy
Hmm makes sense, I guess. I'm far from the computer but I'll post it tomorrow 👍
18 replies
RRailway
Created by molul on 12/31/2022 in #✋|help
strapi project deletes all data and config on every deploy
But strapi is connected to a postgres database from the very first deploy. Shouldn't it be stored there?
18 replies
RRailway
Created by molul on 12/31/2022 in #✋|help
strapi project deletes all data and config on every deploy
Ok, so what should I do if/when I want to make a modification to the CMS?
18 replies
RRailway
Created by molul on 12/31/2022 in #✋|help
strapi project deletes all data and config on every deploy
Project ID: 3fedc45b-412f-4493-8ac0-01faa7d93ccb
18 replies