T
Twentyβ€’9mo ago
greg [iero]

Update Docker install

Hello, I installed version 0.3.0 and I'm looking for updating the installation to last version. How can I do that? Thanks
14 Replies
charles
charlesβ€’9mo ago
Ok, so first you should do a dump of your database. Then, can you run: node dist/src/command.js workspace:health --workspace-id {YOUR_WORKSPACE_ID} -d? We will need to check what's outdated in your schema first
greg [iero]
greg [iero]OPβ€’9mo ago
In the server container right ? How can I find the workspace id ? Is it the workspace "name"? I backup the "default" database
Weiko
Weikoβ€’9mo ago
In your db you should have a workspace table where you can retrieve your id (you most likely only have one row, excluding the ones provided in the seeds if you still have them)
greg [iero]
greg [iero]OPβ€’9mo ago
Got it. I have mine and a default "Apple" one
greg [iero]
greg [iero]OPβ€’9mo ago
Here it is
charles
charlesβ€’9mo ago
mmmh true, you are not on the latest version so you don't have the command yet :p Ok, so start by doing a dump of your database. Then, update your infra to use 0.3.2 version (pull v0.3.2 branch if you are using git, rebuild your containers id you are using docker...) It is very likely that this will break your CRM, we will need to make changes to the database to match the 0.3.2 features in 0.3.1 we have introduced some commands to migrate workspace between versions, they will help for future migrations but they are not there yet on 0.3.0
greg [iero]
greg [iero]OPβ€’9mo ago
I can use "TablePlus" to backup my database or do I need to do a specific dump? No worries if I loose my database, I can rebuild it. Usually I use pg_dump -U twenty -h localhost -p 5432 -F c default > db.tar but I don't know if it's enough
greg [iero]
greg [iero]OPβ€’9mo ago
After I can update like that right ?
No description
charles
charlesβ€’9mo ago
oh so you don't care about the data in it? If yes, this is WAY easier :p
greg [iero]
greg [iero]OPβ€’9mo ago
I can re-enter the data, it's OK
charles
charlesβ€’9mo ago
ok so in this case, just delete your containers and rebuild them πŸ™‚ then re-init your database and you should be good to go!
greg [iero]
greg [iero]OPβ€’9mo ago
OK I've successfuly updated and restarted everythong. But I have an error when I try to initiate the DB
greg [iero]
greg [iero]OPβ€’9mo ago
I tried :
/app/packages/twenty-server # yarn nx run twenty-emails:build

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

> NX Ran target build for project twenty-emails (64ms)

βœ– 0/0 failed
βœ” 0/0 succeeded [0 read from cache]


> NX Invalid Cache Directory for Task "twenty-emails:build"

The local cache artifact in "/app/.nx/cache/601695131239505140" was not generated on this machine.
As a result, the cache's content integrity cannot be confirmed, which may make cache restoration potentially unsafe.
If your machine ID has changed since the artifact was cached, run "nx reset" to fix this issue.
Read about the error and how to address it here: https://nx.dev/recipes/troubleshooting/unknown-local-cache

Pass --verbose to see the stacktrace.
/app/packages/twenty-server # yarn nx run twenty-emails:build

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

> NX Ran target build for project twenty-emails (64ms)

βœ– 0/0 failed
βœ” 0/0 succeeded [0 read from cache]


> NX Invalid Cache Directory for Task "twenty-emails:build"

The local cache artifact in "/app/.nx/cache/601695131239505140" was not generated on this machine.
As a result, the cache's content integrity cannot be confirmed, which may make cache restoration potentially unsafe.
If your machine ID has changed since the artifact was cached, run "nx reset" to fix this issue.
Read about the error and how to address it here: https://nx.dev/recipes/troubleshooting/unknown-local-cache

Pass --verbose to see the stacktrace.
OK now I had some sleep, I followed what was said in the error and I run those three commands:
/app/packages/twenty-server # yarn nx reset
/app/packages/twenty-server # yarn nx run twenty-emails:build
/app/packages/twenty-server # yarn database:reset
/app/packages/twenty-server # yarn nx reset
/app/packages/twenty-server # yarn nx run twenty-emails:build
/app/packages/twenty-server # yarn database:reset
No error anymore, everything seems good. I have two questions here: - Can I set something in the .env to have a clean database without companies/people already filled? - Is there a way to backup (and restore) the datamodel only (without data) using API or even pg_dump?
charles
charlesβ€’9mo ago
Great! - not at the moment but is very easy to clean in your DB, we could also add an environment variable to disable workspace prefill on creation - pg_dump --schema-only might do the trick
Want results from more Discord servers?
Add your server