Focalboard: Recovery of (accidentally) deleted board

Hi again,

I did reproduce that on my system and it seems that the deleted board is being removed from the blocks table and being written to the blocks_history table, so on your system, you should see the following entry with the name of the board you deleted:

sqlite> select id,insert_at,type,title  from blocks_history where type='board' and delete_at > 0;
+-----------------------------+-------------------------+-------+------------+
|             id              |        insert_at        | type  |   title    |
+-----------------------------+-------------------------+-------+------------+
| buws7fmw9xiy55fg8t747kooe4c | 2022-08-04 03:46:25.460 | board | mein board |
+-----------------------------+-------------------------+-------+------------+

What I did to get it working was to copy over this record to the blocks table (to make it active again) and to reset the delete_at column afterwards:

insert into blocks select * from blocks_history where id='buws7fmw9xiy55fg8t747kooe4c';
update blocks set delete_at=0 where id='buws7fmw9xiy55fg8t747kooe4c';

If that worked and restored your board, you should also clean the entry in the blocks_history table then, not sure if it’s OK that the same ID exists in both tables:

delete from blocks_history where id='buws7fmw9xiy55fg8t747kooe4c';

This got my previously deleted board restored, I hope this also works for you.