T
Twenty3mo ago
Bhavin

How to backup existing DB data to latest twenty version ?

Hello, Everytime we make any changes to add custome field or entity to DB, the changes doesn't get reflected in .nx cache folder or dist folder in twenty server. Is there any way i can sync changes made in code to cache folder and dist. ?
7 Replies
Bhavin
BhavinOP3mo ago
I have dump of pervious version with data and now i have moved to latest version of twenty but when i am using npx nx run twenty-server:command workspace:sync-metadata -f command for sync of fields and entities to my existing db , i am getting error like ... this column activitationStatus does not exist. This might work if i use database reset command but i dont want to reset that. Is there any way i can sync with data loss ?
Bhavin
BhavinOP3mo ago
No description
charles
charles3mo ago
Hi @Bhavin, you are facing two different issues 1) To upgrade to the new version, please follow our upgrade guide: https://twenty.com/developers/section/self-hosting/upgrade-guide. I think you are missing the yarn database:migrate:prod step 2) whenever you add custom fields/objects, it's not reflected in the files, it's reflected in the metadata db schema. What we have in the code correspond to the "standard" object and fields that will also be reflectin the the metadata db schema while doing sync-metadata
Rishi S
Rishi S3mo ago
Hey @charles the guide you've shared is about migrating from 0.21* to the next version: v0.21.0 to v0.22.0 v0.22.0 to v0.23.0 v0.23.0 to v0.24.0 https://twenty.com/developers/section/self-hosting/upgrade-guide But here we've a special case, we were on 0.3.3 (with user's data in DB) and we've merged the latest changes of 0.23 (so we're on 0.23). As there are lots of schema changes, we need to just sync the latest schema from merged 0.23 codebase. In that case, we need to go with the same steps mentioned in the upgrade-guide? yarn database:migrate:prod yarn command:prod upgrade-0.24 We tried both and getting errors. Just wanted to confirm that can we retain data if we migrate from 0.3.3. to 0.23 at one go?? Seeking your help and we appreciate your prompt reply.
charles
charles3mo ago
@Rishi S, please DM me for this case, I'll assist you in migrating from 0.3.3 to 0.23 but let's do it in private as this might disclose some private data
Rishi S
Rishi S3mo ago
I've DMed you @charles, if you can help that would be really helpful.
charles
charles3mo ago
Ok, let's work from there 🙂
Want results from more Discord servers?
Add your server