From 837fd367c7c65ff26e454f9adfbd23c68e60e6de Mon Sep 17 00:00:00 2001 From: fliiiix Date: Sun, 14 Jan 2024 17:19:27 +0100 Subject: [PATCH] doc: how to update comments.db --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 490d534..a493cab 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,25 @@ stork --build stork.toml ``` then a github action builds and publishes `bgt.st` to https://search.binaergewitter.de/bgt.st. + +# Update comments after rename + +If you rename a post you should migrate the old comments. +Since the id for comments is the post title: . + +1. Get the `comments.db` +1. Create a backup +1. Look up the old id and new id in the `threads` table (i use `sqlitebrowser`) +1. Run the update command `UPDATE comments SET tid=$newid WHERE tid=$oldid;` +1. Save file! +1. Upload `comments.db` again + + +``` +scp binaergewitter:/var/lib/isso/comments.db ~/Downloads/comments.db +cp ~/Downloads/comments.db ~/Downloads/comments_bak.db + +sqlitebrowser + +scp ~/Downloads/comments.db binaergewitter:/var/lib/isso/comments.db +```