Hmmmmokay so let’s try a dirty hack …
sudo mkdir /var/opt/mattermost
sudo chmod 777 /var/opt/mattermost
then retry the restore …
If the restore does work, we should try to set some more meaningful permissions on the folder … not sure exactly but at least something like chmod 775 /var/opt/mattermost
… but we’ll discuss this if we confirm that the restore worked