Railway Strapi
Hi. It's taken me entire day and I think I am getting close. I deployed Strapi with postgres on Railway - everything is okay. First issue was getting that thing to be in development mode so I can add new content-types, I did it by modifying package.json like in this tutorial: https://dev.to/candidosales/deploying-strapi-4-to-railway-589b
Everything worked till first "rebuild". DB is wiped, starting from 0. I read about this issue and I really have no idea what to do. Even if I did data transfer from local version like this: https://docs.strapi.io/dev-docs/data-management/transfer there would be schema issues (for example there wouldn't be "post" types created). I have truly no idea what to do.
Data transfer | Strapi Documentation
Transfer data using the Strapi CLI
21 Replies
Project ID:
N/A
7a9a91c1-3dbb-499f-ab6a-50767c5b05d0
I spent last 30 minutes on reading strapi issues/thoughts and one thing that @Brody said made me wonder - if I clone the repo to my own PC and I run it in development mode, make some changes (it should be connected to postgres railway DB) and then i change back to production and push it should work?
thats correct
run in development mode locally with
railway run strapi develop
so that strapi has access to the database credentials from railway.
make sure your start script is set to strapi start
so when you deploy to railway its run in production modei dont get it, i linked railway to project
and i cant do anything
how do i download it, its weird
Ok, I had to clone repo, run npx railway here and its slowly getting to work i think
i will journalize my efforts here - now i will run 'npx railway run strapi develop', add some stuff, then push github and hopefully mt DB doesnt get wiped
also updated strapi to 4.13.5 and pgsql to new version with yarn install, pushed and it also worked - miracle
now final test, if i add new content on railway in PROD mode will it stay after "rebuild"
Also I don't recommend using your production database to develop locally, I recommend using SQLite.
Docs: https://docs.strapi.io/dev-docs/configurations/database
Database | Strapi Documentation
Strapi offers a single entry point file to configure its databases.
at this point i just want it to work π its literally portfolio project because im looking for a front-end job and i coded nice react blog with strapi
yoo looks like it works
thank u @Brody so much, without all your replies to people aruond i'd never do it
it FU**ING WORKS
that's awesome!!
looks like you have some styling issues to sort out
its not responsive yet
it will be, but just wanted it to "be alive" as its my first next.js project ever
pretty damn good for your first next project
after 3 days of fighting strapi making it responsive is the easiest part
(note: i was designing simple bootstrap html landing pages for last 7 years and this year i decided to learn real javascript + react)
I still don't know real JavaScript+React
u know how to set up strapi
that puts u ahead of 99% π
I've also never used strapi
damn!
I've only read their documentation
so that reminds me, do you have
pool.min
set to 0
in your database.js file?yes sir
thank u for being cautious
i copied official strapi railway repo
perfect then I'm glad I put the pool min thing in the template