# Import from a remote source

**URL:** <https://forum.pydio.com/t/import-from-a-remote-source/5475>\
**Category:** Pydio Cells\
**Tags:** upload\
**Created:** [August 20, 2023, 3:11am UTC](https://forum.pydio.com/t/import-from-a-remote-source/5475 "2023-08-20T03:11:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![drzraf](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/drzraf/32/1207_2.png) [@drzraf](https://forum.pydio.com/u/drzraf)\
**Post date:** [September 6, 2023, 5:30pm UTC](https://forum.pydio.com/t/import-from-a-remote-source/5475/4 "2023-09-06T17:30:42Z")

</div>

Reading and exploring further on this:

- [Structured Data Import](https://forum.pydio.com/t/structured-data-import/5462)
- [Mount smb/cifs as datasource does not work in v4.2.2 - #15 by nodejs](https://forum.pydio.com/t/mount-smb-cifs-as-datasource-does-not-work-in-v4-2-2/5361/15) which advise of using `CELLS_MINIO_ALLOW_CROSSMOUNT=true`

1. If mounting (from NFS, Samba, rclone, …) the **parent** directory is considered. But using a parent directory, leads to `Export path should not have any sub-mounts`.

2. Assuming (for now) we are fine importing only **subdirectory** as a datasource, we get hit by  
`Checking parent folder is writable before creating datasource` (why can’t we add a truly read-only datasource, not only read-only workspace? ⚠)

3. Let’s make this writable by doing an overlayfs out of the parent directory and give it permission to Pydio:  
`mount -t overlay overlay -o lowerdir=where-rclone-mount-google,upperdir=_upper,workdir=_workdir pydio-mntpoint && chown -R pydio pydio-mntpoint` and point datasource to `pydio-mntpoint/subdirectory` (Remember above point #1)

4. Here I got `object service local2 is already pointing to XXX, make sure to avoid using nested paths for different datasources` (XXX is the parent of `pydio-mntpoint/`) **but** removing/recreating the datasource got rid of this.

5. From here I could create a read-only Workspace, but the `copy` option is disabled (the workspace must be made read-write even if the goal is just to copy files out into another workspace) ⚠

6. Side note, even deactivating the datasource, the umount is impossible `target is busy` (the datasource must be **deleted** first, which is, at least, very inconvenient ⚠)

Overall, this sounds doable with the below sample hierarchy:

```auto
├── _upper # overlayfs (to make the it seemingly writable to Pydio) 
│ └── origin
│ ├── a.txt
│ ├── b.txt
│ └── subdirectory
│ ├── c.txt
│ └── d.txt
├── _workdir # overlayfs
│ └── work
├── one-level # This is the intermediary directory needed by Pydio
│ └── origin # This is where you would mount your SMB/NFS/Google/rclone-mount/...
│ ├── a.txt
│ ├── b.txt
│ └── subdirectory
│ ├── c.txt
│ └── d.txt
└── pydio-mntpoint # The overlayfs mount-point
    └── origin # The directory to present to Pydio when creating a datasource
        ├── a.txt
        ├── b.txt
        └── subdirectory
            ├── c.txt
            └── d.txt

```

[tbc]

---

_[View the full topic](https://forum.pydio.com/t/import-from-a-remote-source/5475)._
