How to restore a postgres database? #1608
-
Because SpiceDB uses postgres's internal txids, it's been identified that standard restore operations (pg_dump/pg_restore) do not work as the new database would not have the same txids. This in itself is fairly unexpected, I don't think that anybody who's not privy to the internals of spicedb would expect it. As far as I can see, there's no documentation of how to restore a spicedb database. A quick search (and some awareness of discussions in Discord) led me to Zed's Things I'd love:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Yes, it does a full backup of the schema and all its relationships, but not relationship history
The zed operation calls the SpiceDB APIs
This is mostly in case we decide to change the API contract itself; they do work |
Beta Was this translation helpful? Give feedback.
-
@williamdclt a new |
Beta Was this translation helpful? Give feedback.
-
Hey @williamdclt thanks for asking. I was facing the same issue and it was driving me nuts |
Beta Was this translation helpful? Give feedback.
-
Hey @vroldanbet I tried to run the commando to repair the spicedb restore but I got this error, do you know or have any idea what it can be? Thanks PS: I use Postgres v14.10 $ spicedb datastore repair transaction-ids
1:24AM ERR terminated with errors error="ERROR: function max(xid8) does not exist (SQLSTATE 42883)"
command terminated with exit code 1 |
Beta Was this translation helpful? Give feedback.
@williamdclt a new
spicedb repair
command was built specifically to address this problem: #1642. It should become available in the upcoming 1.28.0 version.