We were just migrating from postgres 14
# spicedb
g
We were just migrating from postgres 14 to postgres 16. We used
pg_dump -Fd -j 4 -b -v -f "<filename>" -U <user> -d <db> -h <host>
to take a backup and
pg_restore -Fd -j 4 -v -U <user> -h <host> -d <db> <filename>
to restore the data. Everything looked ok in the DB. We could see all the relationships and the schema but any query to read the schema or check some permission would fail saying `rpc error: code = FailedPrecondition desc = object definition
thing
not found`. And reading the schema gave us
grpc_message:\"No schema has been defined; please call WriteSchema to start\"
even though the schema existed in the db and we had already called the writeschema method with our schema. We ended up "solving" the issue by deleting all the rows in the
namespace_config
table and calling WriteSchema again. Should we have done something differently during the migration or?
v
yes, you should have. pg_dump as-is is not supported. The reason is SpiceDB relies on Postgres internal MVCC primitives to implement its own snapshotting system. So if you do pg_dump on a new server, then you need to subsequently run
spicedb datastore repair
to get the MVCC bits repaired. After that it should work as usual.
123 Views