BetaThis is a live doc! Anyone with edit access can make updates in real time without having to publish.
By Bryan
In progress
logto 对于数据库的要求较高,例如要求对应角色拥有 superuser 权限(因为会需要 create role bypass rls)
另外,logto 在操作数据库的时候其实是使用了多个用户的,并将用户的密码保存在数据库中(咱也不知道为啥要这么设计。。 直接 set role 不行嘛),因此造成迁移的过程比较十分的困难
迁移方案
重新安装 logto 到指定数据库,停止 logto 的运行
查看新的 tenants 表,记住当前的 db_user 和 db_user_password
恢复数据库,注意添加 -c 来保证数据库被清理干净
在新的数据库中中修改 tenants 表中的密码为之前的
重新启动 logto 检查数据是否正常