Restore failing with missing chat_mention function

Ok, so here’s what I did:

  1. Make sure the /var/discourse/shared folder was empty, or moved to a new location in case we need to restore
  2. Initialized a new discourse instance using ./launcher bootstrap
  3. Tried the restore again and still failed at same error message.
  4. Then, When I did a dump of my good discourse instance, i found the actual command that creates the function. It is:
CREATE FUNCTION discourse_functions.raise_chat_mention_notifications_old_notification_id_readonly() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
  BEGIN
    RAISE EXCEPTION 'Discourse: old_notification_id in chat_mention_notifications is readonly';
  END
$$;


ALTER FUNCTION discourse_functions.raise_chat_mention_notifications_old_notification_id_readonly() OWNER TO discourse;

Then retried the restore, and it all went well!

Now, I had the log where it failed and thought I could go back to it afterward, but the logs are reset with every Backup/Restore feature.

ENHANCEMENT: It would be nice to have a history of backups/restores. Maybe there is one, and I don’t know where it is.

DISCLAIMER: I am not a support person from Discourse, so I will not go into how to get into psql command line prompt to run the above commands. : :slight_smile: