Update from 0.3.2
Hello,
I have a docker install in version 0.3.2.
What are the right steps to update the system to the last version?
54 Replies
Hi @iero! Hope you are doing well
For now, we recommend migrating step by step:
- 0.3.2 > 0.3.3 > 0.4.0 > 0.10.0
However, I can assist you and go directly to 0.10.0 if you like
You'll experience some downtime though
First, update your containers to use v0.10.0
Yes it will be good to go directly to 0.10.0
I will backup first
ok!
Could you confirm that I'm OK with this dump? Nothing more to backup?
I'm doing:
pg_dump postgres://user:password@domain:5432/default > 04-22-2024.sql
so it looks good, not sure about -Fc options and what they do
Ok done both to be sure:
I remove containers and update to last version ?
keep your database instance, are you using a persistent storage? you should only update the container images but keep the data (even if you have made a dump)
I have the three containers:
The database is in a docker container
I might test in a test environment to be sure 🙂
could you share your docker-compose.yaml (or compose.yaml)
sure:
ok so you have a persistent volume
which is good
make sure your database backup contains your data by browsing it quickly and you should be good to go to update your TAG to v0.10
Yes, I looked for Companies, Projects and other objects and they are in in the dumps
ok!
let's upgrade and fix the migration issues
I keep the DB container and I upgrade others or do I update them all?
Keep the DB container :
- it's fine as we haven't change anything there since 0.3.2. However it's good to see how to upgrade it for the future
Upgrade the DB container :
- should be fine but I have never tried it with a self host version so I'm not sure
OK I updated my docker-compose.yml with those parameters:
I updated the TAG variable to 0.10.0 in .env file and run
seems to work. But when I log to localhost:3000 I have a blank page
OK I found some errors in db container:
your db seems fine 🙂
you could use v0.10 as a tag (you'll get the patch upgrades for free, we are already in v0.10.2)
If the frontend is blank, the starting point is chrome network tab!
Sounds not bad
what's the return of the graphql call?
I have
in the source
I suspect it's failing 🙂
graphql:
This is normal as react code is not present in the source code (we don't support SSR)
ok, so your FE is correctly setup and your backend is not
what do you have in your server logs?
I just have server and db now, just two containers
here is the complete log:
mmh, looks good. what do you see on sgl.local/graphql ?
Another question, why have you reset your database? is this intentionnal?
I did not reset the DB, it was done during the update..
ok I found one issue, server name was not good
has to be localhost here
you are right. It's a good think you have a backup...
@Quentin G FYI, I feel the auto setup of the database should be a parameter
Does your FE load?
The
yarn database:migrate:prod
on first boot ?mmmh sorry!
You are right, it's not a reset it's a migrate
all good!
It's relying on a lock on the fs, which was missing i assume. Auto init would be interesting to keep to ease new installs, but I could look for signs of already initialised database
it's all good, I thought it was the reset script but it's only the setup one which is non destructive
:aniblobsweat:
all good then 😄
I do have to launch "yarn database:migrate:prod" ?
No it has already been done!
OK the front is working now
I have to restore the db I think
I expect your workspace schema to be broken
I cannot log with my old account
You don't have your data in your db anymore ?
Check your postgres content first?
It should still be there
But your server should show erroeq
Nope, the DB is empty
I will load the backup tomorrow
after I just need to launch
yarn database:migrate:prod
?
I have this error in the server :
Because the user doesn't exists I imagine?About the missing data, i would say it comes from the volume name mismatch between old and new docker compose
It went from
To
Data is probably still one the disk 🙂
If you wish to use the new name, here is a quick way to transfer data i found
https://github.com/moby/moby/issues/31154#issuecomment-360531460
OK so I tried to restore database:
I connected to the database and it seems to be there.
I started a yarn db migrate but I had some errors
When I try to log-in, I have this error
@charles Any idea? I can erase and restart if needed
yes we have an issue with migrations since 0.3.2 🙂
You can take a look at the thread here: https://discord.com/channels/1130383047699738754/1232303531256578099/1232596961828405309
migrating to 0.10 is possible but not easy. If you think it's easier to restart from scratch and put back your data it might be a better way.
Upcoming migrations will be easier 🙂
If you still want to migrate: regarding your error, there is a missing FK in the database: FK_2ec910029395fa7655621c88908 you need to create it manually before re-reunning migrations again
I have a lot of data to migrate, so I'm not sure I can put back my data manualy.. or I have to code a lot using API
I'm a little bit lost. How/Where can I add this FK?
Ok, let's migrate your workspace then!
do you have a postgres UI client? like Dbeaver or Postico?
We can schedule a 30 min session if needed 🙂
I have "Tableplus" and I just installed Postico
I'm available today if you have some time
does 2pm Paris time work for you?
yes good for me!