- Load data with
kubectl exec -it postgres-immersion-0 -- env PGPASSWORD=$PGPASSWORD psql $DATABASE -U $PGUSER < ./backup_tadoku_prod_20230125_015624.pgdump
with the correct parameters. Make sure this creates a new schema old
.
- Add new fields to store the new UUIDs
alter table old.contests add column new_id uuid default (uuid_generate_v4());
alter table old.contest_logs add column new_id uuid default (uuid_generate_v4());
alter table old.users add column new_id uuid default null;
- Check if the configuration is correct in
migrate.js
- Run the migration script
pnpm run migrate
- There might be some conflicting users, you can ignore those.
- Generate the query to fix the
created_at
timestamps and apply it kratos db pnpm run kratos | pbcopy