pirate said, on 2021-05-23 at 08:26
> Speaking of which, horse fucker eels aside, I'm going to write a
> tool to make migrations easier. For now, here's the gist of how
> they happen. If a board changes URLs, our best practice for now
> is to assign the old URL / set of posts a new nickname, and then
> one can give the "proper" name to the new domain.
> Set the old board's URL to " " or similar in settings.py!
> The trick to "renaming" a board (e.g. from "old" to "new") is this :
First, replace every ./threads/*/*/old.txt with ./threads/*/*/new.txt
I did this by
> ls ./threads/*/*/old.txt > files.txt
and then I used an emacs macro to make every instance of (for example)
> ./threads/somewhere/12345/old.txt
become
> mv ./threads/somewhere/12345/old.txt ./threads/somewhere/12345/new.txt
Next, replace every instance of "old" in every threads/*/*/list.txt
with "new" -- generate a file list with
> ls ./threads/*/*/list.txt > files.txt
I again used emacs in this file to prefix every instance like
> ./threads/somewhere/12345/list.txt
with the rename command:
> sed -i "s/old/new/g" ./threads/somewhere/12345/list.txt
Finally,
> mv ./threads/old/ ./threads/new/
> sed -i "s/old/new/g" ./threads/list.txt
After you run python3 refresh.py, the board's name will have changed
properly, while >>replies stay intact.