Strapi Heroku to Railway
Hey, I'm new to this side of development and have taken a website on to help a friend out. I'm trying to move their Admin site from Heroku to Railway but having a little trouble.
I had the migration finished and everything working, then I realised I had an env variable that points to the heroku instance (postgres db). I removed the variable to check if it still works but got the following error:
strapi start [2023-02-24 12:04:13.309] debug: ⛔️ Server wasn't able to start properly. [2023-02-24 12:04:13.312] error: connect ECONNREFUSED 127.0.0.1:5432 Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)Is there an easy way for me to expose this url? I tried following the docs https://docs.railway.app/databases/postgresql but I can't see where to find the variable DATABASE_URL. And lastly, once this is working, will I need to do a PG Dump from Heroku and PG Restore in Railway?
3 Replies
Project ID:
36be635e-5b14-45df-8b89-03b99c89984d
You might find these helpful:
- Migrating From Heroku To Railway
- Connection issue with postgres on tutorial
- Unable to migrate Commento++ Heroku project to Railway
⚠️ experimental feature
36be635e-5b14-45df-8b89-03b99c89984d
I might be misunderstanding and need to also have a database instance? Sorry if this is me being dumb, I thought this was all included as part of strapi.
I think this is what I was doing wrong, so I've managed to get the database setup and done a pg_dump and pg_restore, but have another issue,:
However, this error makes sense as I wouldn't have this user on this database.
Anyway, I've ran the deployment without adding the user and it works, so I think I'm all good and hope this helps other people.