# Migrating files to Nextcloud, occ scan failes, could be permissions \[solved\]

**URL:** <https://forum.yunohost.org/t/migrating-files-to-nextcloud-occ-scan-failes-could-be-permissions-solved/26790>\
**Category:** Support\
**Tags:** migration, mariadb, ssh, french\
**Created:** [October 16, 2023, 8:45am UTC](https://forum.yunohost.org/t/migrating-files-to-nextcloud-occ-scan-failes-could-be-permissions-solved/26790 "2023-10-16T08:45:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![wbk](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/w/e0b2c6/32.png) [@wbk](https://forum.yunohost.org/u/wbk)\
**Post date:** [October 18, 2023, 9:53pm UTC](https://forum.yunohost.org/t/migrating-files-to-nextcloud-occ-scan-failes-could-be-permissions-solved/26790/4 "2023-10-18T21:53:11Z")

</div>

Hi eamonn,

> [@wbk](#):
>
> Let me look up another post about ACLs

It turns out I was also connecting to Nextcloud that time, have a look at [Access nextcloud via SSHFS - #9 by wbk](https://forum.yunohost.org/t/access-nextcloud-via-sshfs/16939/9) for the configuration of permissions I used.

Paraphrasing,

> [@eamonn](#):
>
> I performed (…) the rest as a normal user (…) using sudo when required.  
> (…)  
> Looking at [/home/user/share?] more closely, it seems that the user folder in my _/home/user_ is the same one as _/home/yunohost.multimedia/user_

So, on which directories did you run chmod 664, and was it necessary to use sudo in those cases? My hunch is that some file needs to be executed to connect to the database, but 664 does not allow execution, hence `Failed to connect to the database:`

Is your Nextcloud installation itself still functional? Can you scan other folders? How long has the system been installed and used?

Depending on the situation, I could run an `ls -hals` on my copy of the directory that has trouble on your side so you can compare them. On the other hand, if nothing has been installed or uploaded, pending this issue, before starting to use the system, the amount of troubleshooting (and learning 😉 ) might not be in balance with re-installing.

By the way: the fact that you needed to run occ files:scan implies that you did not connect to Nextcloud via WebDAV. Did you have a reason for using a direct filesystem copy, did the WebDAV connection not work?

---

_[View the full topic](https://forum.yunohost.org/t/migrating-files-to-nextcloud-occ-scan-failes-could-be-permissions-solved/26790)._
