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