# Restore failing with missing chat\_mention function

**URL:** <https://meta.discourse.org/t/restore-failing-with-missing-chat-mention-function/331376>\
**Category:** Bug\
**Tags:** fixed\
**Created:** [October 17, 2024, 3:18pm UTC](https://meta.discourse.org/t/restore-failing-with-missing-chat-mention-function/331376 "2024-10-17T15:18:47Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![dennisjbr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dennisjbr/32/444916_2.png) [@dennisjbr](https://meta.discourse.org/u/dennisjbr)\
**Post date:** [October 21, 2024, 6:35am UTC](https://meta.discourse.org/t/restore-failing-with-missing-chat-mention-function/331376/13 "2024-10-21T06:35:38Z")

</div>

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:

```plaintext
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. : 🙂

---

_[View the full topic](https://meta.discourse.org/t/restore-failing-with-missing-chat-mention-function/331376)._
