#Keeping dev branches in sync
1 messages · Page 1 of 1 (latest)
Searched sync dev test production instances database clone
Found 10 results
Searched environment setup configuration deployment
Found 9 results
The documentation doesn't have a specific guide for cloning/syncing instances between environments, but based on what's covered, here's what you need to know:
It's not just the database. To fully clone a Twenty instance, you need to account for these components:
- PostgreSQL database -- This is the primary data store containing your workspace data, metadata, and (if
IS_CONFIG_VARIABLES_IN_DB_ENABLED=true, which is the default) your configuration variables. This is the most critical piece. - Redis cache -- Twenty uses Redis for caching. After restoring a database to a new instance, you should flush the cache to avoid stale/inconsistent data:
yarn command:prod cache:flush - Server local data volume -- If you're storing files/attachments locally (the
server-local-datavolume in Docker Compose), you'll need to copy that as well. - Environment variables /
.envfile -- Infrastructure settings likeSERVER_URL,APP_SECRET,PG_DATABASE_URL, andREDIS_URLare configured via.envand will differ between environments. Make sure your dev/test.envpoints to the correct URLs and services.
Recommended approach for syncing prod to dev/test:
-
Dump the prod database:
docker exec -it {db_container} pg_dumpall -U {postgres_user} > databases_backup.sql -
Restore to your dev/test database:
cat databases_backup.sql | docker exec -i {dev_db_container} psql -U {postgres_user} -
Copy the file storage volume if you use local storage for attachments.
-
Flush the Redis cache on the dev/test instance:
yarn command:prod cache:flush -
Ensure your dev/test
.envhas the correctSERVER_URLand other infrastructure variables for that environment.