T
Twenty5mo 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
charles5mo ago
Do you want to migrate the whole data ? why not using pg_dump / psql to dump and restore?
greg [iero]
greg [iero]5mo 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
NathanOP5mo ago
yes charles I want to move the whole thing. I'll try it out later today.
greg [iero]
greg [iero]5mo 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
NathanOP5mo ago
Hey guys so first I was trying to upgrade my twenty to 0.22 abd now I'm getting this error.
Nathan
NathanOP5mo ago
No description
Nathan
NathanOP5mo ago
followed the upgrade guide https://twenty.com/developers/section/self-hosting/upgrade-guide but same thing any help @charles @greg [iero]
charles
charles5mo 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
NathanOP5mo 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
NathanOP5mo 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
thomast5mo ago
Hi, will look into this on Monday! And @charles will be back from PTOs as well
Nathan
NathanOP5mo ago
Hi @thomast any help today
thomast
thomast5mo ago
cc @charles I think you had more context on this one
Nathan
NathanOP5mo ago
Thanks @thomast only @charles can save me now
charles
charles5mo 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
Nathan
NathanOP5mo ago
Sure thing Charles Let me know @charles Let do this at 5:30 pm EST! whould that work for you?
charles
charles5mo ago
it's a bit too late (11:30pm in Paris), could you do earlier in your day?
Nathan
NathanOP5mo ago
Hi @charles Sure thing let's do this tomorrow. Let me know when you are available.
charles
charles5mo ago
tomorrow at 6:30pm Paris Time? would that work for you?
Nathan
NathanOP5mo ago
yeah @charles that sounds great!
charles
charles5mo ago
great! @Nathan ping me when available
Nathan
NathanOP5mo ago
@charles sorry about yesterday are you free today ?
charles
charles5mo ago
Hi @Nathan, no worries! Would you be available today? or tomorrow? :p I see you typing haha
Nathan
NathanOP5mo ago
oh yes This week I'm away we can do it this weekend though
charles
charles5mo ago
next Monday?
Nathan
NathanOP5mo ago
Well we can try it
charles
charles5mo ago
what time?
Nathan
NathanOP5mo ago
morning at 11:30 am Paris time? My timezone is IST 😂
charles
charles5mo ago
11:30 am Paris time is perfect! I've booked a slot in my agenda see you on Monday
Nathan
NathanOP5mo ago
See you Charles
charles
charles4mo ago
We haven't synced yet :p any other availability 😉 let me know @Nathan 🙂 closing the issue, feel free to re-open it 🙂
Want results from more Discord servers?
Add your server