Thank you for your help @neil!
There’s an (unrelated) error message:
/var/www/discourse/app/models/topic_tracking_state.rb:249: warning: circular argument reference - archive_user_id
Then the category-export file is empty:
I tried with
RAILS_DB=sitename where entries in data.yml are like
sitename: followed by the list of pups commands, addressing a database name that’s different. I tried adding DISCOURSE_DB_NAME as well without result. I got the category_id from the Rails console: