TwentyCRM + MinIO S3

5 months ago

Description: The #1 Open-Source CRM Modern, powerful, affordable.

Category: Other

URL: https://railway.com/template/4_LQ-T

13 Replies

speenoo
PRO

4 months ago

Hey the postgres is empty when it deploys. getting a relational error. any idea how to fix it?


speenoo

Hey the postgres is empty when it deploys. getting a relational error. any idea how to fix it?

4 months ago

Hi, @speenoo! Thanks for reaching out.

I've just deployed the template and I wasn't able to reproduce the error. Postgres is provided using the default Railway template and not the default Postgres image by TwentyCRM. I would suggest try to deploy it again later or maybe creating a new database after deploying the template, just rename it as the default Postgres container and verify that env is pointing to it.

If the issue still persists please share maybe a SS or Logs to investigate more :)


macromillion
PRO

3 months ago

The postgres database is empty when deploying and re-creating a database doesnt work. Everything else works though just cant login.


macromillion

The postgres database is empty when deploying and re-creating a database doesnt work. Everything else works though just cant login.

3 months ago

Hi @macromillion! Thanks for the info.

I have checked and indeed the migrations were not running (that's why you can login). I'm currently investigating this, since I don't know why the entry point is not running. But meanwhile there's an updated template with a temporary fix (running migrations as a pre-deploy command), now it runs!

Also I've updated removed the latest tag. I must now update after checking each new version since they are a good team and they move fast and sometimes it's hard to keep up with them!


roicort

Hi @macromillion! Thanks for the info.I have checked and indeed the migrations were not running (that's why you can login). I'm currently investigating this, since I don't know why the entry point is not running. But meanwhile there's an updated template with a temporary fix (running migrations as a pre-deploy command), now it runs!Also I've updated removed the latest tag. I must now update after checking each new version since they are a good team and they move fast and sometimes it's hard to keep up with them!

3 months ago

Another option is to connect to the container with Railway's new feature, SSH! and run the entry point to create the database and run them or if its already created just "yarn database:migrate:prod && yarn command:prod upgrade". This is also very useful for updating TwentyCRM when there's a new major version (always remember tu dump your DB, just in case). Twenty is currently in v0.

Entry point in question.

sh -c "set -e; if [ \"\$DISABLE_DB_MIGRATIONS\" != \"true\" ] && [ ! -f /app/db_status ]; then echo 'Running database setup and migrations...'; PGUSER=\$(echo \$PG_DATABASE_URL | awk -F '//' '{print \$2}' | awk -F ':' '{print \$1}'); PGPASS=\$(echo \$PG_DATABASE_URL | awk -F ':' '{print \$3}' | awk -F '@' '{print \$1}'); PGHOST=\$(echo \$PG_DATABASE_URL | awk -F '@' '{print \$2}' | awk -F ':' '{print \$1}'); PGPORT=\$(echo \$PG_DATABASE_URL | awk -F ':' '{print \$4}' | awk -F '/' '{print \$1}'); PGDATABASE=\$(echo \$PG_DATABASE_URL | awk -F ':' '{print \$4}' | awk -F '/' '{print \$2}'); PGPASSWORD=\$PGPASS psql -h \$PGHOST -p \$PGPORT -U \$PGUSER -d postgres -tc \"SELECT 1 FROM pg_database WHERE datname = '\$PGDATABASE'\" | grep -q 1 || PGPASSWORD=\$PGPASS psql -h \$PGHOST -p \$PGPORT -U \$PGUSER -d postgres -c \"CREATE DATABASE \\\"\$PGDATABASE\\\"\"; NODE_OPTIONS='--max-old-space-size=1500' tsx ./scripts/setup-db.ts; yarn database:migrate:prod; yarn command:prod upgrade; echo 'Successfully migrated DB!'; touch /app/db_status; fi; exec \"\$@\""


macromillion
PRO

3 months ago

The updated template worked! Thank you very much for the quick response!


winsa
PRO

2 months ago

Hey @Roicort, can you let us know how do keep the instance updated? Will redeploying install the latest version of TWENTY or how can we do this? Appreciate you making this template.


winsa

Hey @Roicort, can you let us know how do keep the instance updated? Will redeploying install the latest version of TWENTY or how can we do this? Appreciate you making this template.

2 months ago

Hi @winsa! I try to keep the templates updated with the latest tagged stable version. Lately the templated pointed to the latest tag, but this proved very difficult to maintain since Twenty is still in v0 and they are moving fast, so I manually update the template after me personally trying each new version.

To update your instance you should update the tag on your container and follow the official update guidelines. https://twenty.com/developers/section/self-hosting/upgrade-guide (this is easier to accomplish through ssh)

Since v0.53 migrations will be done automatically, I will try to update to this version as soon as possible and evaluate having the latest tag again. It's important to notice that migrations should be done sequentially for each version, this means that If you want to upgrade from v0.52 to v0.54 you should first update to v0.53 v.gr.

Hope this helps!


roicort

Hi @winsa! I try to keep the templates updated with the latest tagged stable version. Lately the templated pointed to the latest tag, but this proved very difficult to maintain since Twenty is still in v0 and they are moving fast, so I manually update the template after me personally trying each new version.To update your instance you should update the tag on your container and follow the official update guidelines. https://twenty.com/developers/section/self-hosting/upgrade-guide (this is easier to accomplish through ssh)Since v0.53 migrations will be done automatically, I will try to update to this version as soon as possible and evaluate having the latest tag again. It's important to notice that migrations should be done sequentially for each version, this means that If you want to upgrade from v0.52 to v0.54 you should first update to v0.53 v.gr.Hope this helps!

a month ago

Updated to v0.54. Since here migrations are done automatically. Just be sure to keep changing the version tag for every future version sequentially.


roicort

Updated to v0.54. Since here migrations are done automatically. Just be sure to keep changing the version tag for every future version sequentially.

winsa
PRO

a month ago

Hi @Roicort, thank you so much for your time and effort. Since i didn't fully get started, i just relaunched with a fresh template install. I know this most likely isn't your full time ocupancy, but if you'd have the time, it could be neat to make a video as to how to update the install via railways. I personally use loom.com to record videos. Other than that, how / what do you feel about the recently published v1? Any news as to how we can update to this (now that i'm at 0.54). Again, appreciate your time and effort!


roicort

Updated to v0.54. Since here migrations are done automatically. Just be sure to keep changing the version tag for every future version sequentially.

winsa
PRO

a month ago

Forexample, is it like i try to do here?: https://www.loom.com/share/fcd695a512c74f25bb6ba827d645a9ae


winsa

Hi @Roicort, thank you so much for your time and effort. Since i didn't fully get started, i just relaunched with a fresh template install. I know this most likely isn't your full time ocupancy, but if you'd have the time, it could be neat to make a video as to how to update the install via railways. I personally use loom.com to record videos. Other than that, how / what do you feel about the recently published v1? Any news as to how we can update to this (now that i'm at 0.54). Again, appreciate your time and effort!

a month ago

Hi, Winsa! Wow, I didn´t knew loom.com looks pretty cool. I also didn´t saw V1 as I literally just updated the template one day before (TwentyCMR moves fast) Will be updating the template to v1 asap.


winsa

Forexample, is it like i try to do here?: https://www.loom.com/share/fcd695a512c74f25bb6ba827d645a9ae

a month ago

Yes, exactly. Since version v0.53, no manual actions needed. In order to update to v1. You'll have to update it to v0.60 check migrations were completed successfully. And then the same from v0.60 to v1.0.

If you encounter any runtime issues after upgrading, TwentyCRM points that you may need to flush your cache to ensure it's synchronized with the latest changes.

To do that run this command in your twenty-server container:

yarn command:prod cache:flush

Of course you can make a db backup if there's a lot of sensible information or if not just export your data within Twenty to a csv.

Please let me know if all went good or any related problem!

Happy summer!


TwentyCRM + MinIO S3 - Railway Help Station