Safe way to backup and restore twenty database when workspace entity changed

Hey everyone, I am looking for a way to safely backup and restore the twenty database when there is a change in the workspace entity such as adding a new column or adding a new entity that requires running the command: npx nx database:reset twenty-server Thanks in advance for your help!
7 Replies
Hung Do
Hung DoOP4w ago
Hi @ɃØĦɆᵾS, is there a manual process since I am not using docker compose
thomast
thomast4w ago
You can use pg_dump for your backups, pretty easy to use
ɃØĦɆᵾS
ɃØĦɆᵾS4w ago
You can these commands which I've sent link to, just remove docker part before
Hung Do
Hung DoOP4w ago
Thank you for your suggestion Bob, Thomast. For example, if I add a new workspace entity, the data of the objectMetadata, fieldMetatdata, view, viewField... tables will be newly added corresponding records to this new entitty if I use the database:reset --no-seed command. So which tables should I use the pg_dump command with so that when restoring, the above tables will not be overwritten or have data conflicts. Also I would like to ask if there is any more detailed documentation for developers: for example authentication, authorization, graphQL flow, how to show view in front ...
thomast
thomast4w ago
Ok I am not fully sure I understood your use case in the first place. You want to create a new workspace and seed it with the data of an existing one right? Do you want to keep the existing workspace too? I would advise either to do it manually, either update the workspaceId in object/field/relation metadata but make sure to copy your data first. Once you have the structure, you can copy the records in your workspace schema but once again, not 100% sure it will work 😅
thomast
thomast4w ago
All docs you can find for developers are there https://twenty.com/developers
Twenty - Docs
Twenty is a CRM designed to fit your unique business needs.

Did you find this page helpful?