T
Twenty2mo ago
Nathan

Data Migration to another host.

Hey guys I need to migrate my database from testing server to the main one. Can someone actually help me on this?
31 Replies
charles
charles2mo ago
Do you want to migrate the whole data ? why not using pg_dump / psql to dump and restore?
greg [iero]
greg [iero]2mo ago
Hi @Nathan What I do (and I use the same logic to backup my prod server): On old server :
pg_dump postgres://twenty:twenty@localhost:5432/default > db_today.sql
pg_dump postgres://twenty:twenty@localhost:5432/default > db_today.sql
On new server :
dropdb -U twenty -h localhost -p 5432 default
createdb -U twenty -h localhost -p 5432 default

psql postgres://twenty:twenty@localhost:5432/default < db_today.sql
dropdb -U twenty -h localhost -p 5432 default
createdb -U twenty -h localhost -p 5432 default

psql postgres://twenty:twenty@localhost:5432/default < db_today.sql
Nathan
Nathan2mo ago
yes charles I want to move the whole thing. I'll try it out later today.
greg [iero]
greg [iero]2mo ago
For the record, my backup script :
#!/bin/bash

export DEST="/home/iero/twenty/backup"
export PGPASSWORD="blablabla"

now=`date +"%Y-%m-%d"`

pg_dump postgres://twenty:${PGPASSWORD}@localhost:5432/default | gzip > ${DEST}/db_${now}.sql.gz
#!/bin/bash

export DEST="/home/iero/twenty/backup"
export PGPASSWORD="blablabla"

now=`date +"%Y-%m-%d"`

pg_dump postgres://twenty:${PGPASSWORD}@localhost:5432/default | gzip > ${DEST}/db_${now}.sql.gz
(And yes after I have other scripts that move the files on other locations)
Nathan
Nathan2mo ago
Hey guys so first I was trying to upgrade my twenty to 0.22 abd now I'm getting this error.
Nathan
Nathan2mo ago
No description
Nathan
Nathan2mo ago
followed the upgrade guide https://twenty.com/developers/section/self-hosting/upgrade-guide but same thing any help @charles @greg [iero]
charles
charles2mo ago
HI @Nathan, sure we can help! you are migrating from 0.21 right? could you tell us more about these errors? what do you see in your server logs when hitting these + what do you see in your network tab (browser dev tools)
Nathan
Nathan2mo ago
@charles yes, I was trying to migrate from 0.21 but downgraded to 0.20 right now it's running from 0.20. Here are the server logs and network logs.
Nathan
Nathan2mo ago
Let me know what else you need @charles @charles Need your help here! Any help guys!! My twenty is completly dead I tried to downgrade but nothing works
thomast
thomast2mo ago
Hi, will look into this on Monday! And @charles will be back from PTOs as well
Nathan
Nathan2mo ago
Hi @thomast any help today
thomast
thomast2mo ago
cc @charles I think you had more context on this one
Nathan
Nathan2mo ago
Thanks @thomast only @charles can save me now
charles
charles2mo ago
I'm back! It seems that your database is not successfully migrated. Would you have a time window tomorrow so we can look together. Looks tricky to solve on the chat
Want results from more Discord servers?
Add your server