# SFTP with admin user to migrate uploads folder content

**URL:** https://discourse.roots.io/t/sftp-with-admin-user-to-migrate-uploads-folder-content/7469
**Category:** trellis
**Created:** 2016-08-23T12:59:28Z
**Posts:** 3

## Post 1 by @jasperfrumau — 2016-08-23T12:59:28Z

Now just tried with admin user and SFTP and realized the admin does not seem to have the permissions to create all the directories inside the uploads folder:

```
Command:	cd "/srv/www/domain.com/shared/uploads"
    Response: New directory is: "/srv/www/domain.com/shared/uploads"
    Command:	mkdir "js_composer"
    Error: mkdir /srv/www/domain.com/shared/uploads/js_composer: permission denied
    Command:	mkdir "/srv/www/domain.com/shared/uploads/js_composer"
    Error: mkdir /srv/www/domain.com/shared/uploads/js_composer: permission denied
    Command:	cd "/srv/www/domain.com/shared/uploads/js_composer"
    Error: Directory /srv/www/domain.com/shared/uploads/js_composer: no such file or directory
```

ownership and permissions are:

```
admin@domain:/srv/www/domain.com/current/web/app/uploads$ ls -la
total 24
drwxr-xr-x 6 web www-data 4096 Aug 23 12:36 .
drwxr-xr-x 4 web www-data 4096 Aug 6 03:26 ..
drwxr-xr-x 3 web www-data 4096 Aug 10 07:30 2016
drwxr-xr-x 2 web www-data 4096 Aug 23 12:36 buddydrive
drwxr-xr-x 2 web www-data 4096 Aug 23 12:36 buddydrive-thumbnails
drwxr-xr-x 2 web www-data 4096 Aug 10 07:30 wp-sync-db
```

but I checked and admin cannot create directories. Not after ssh-ing into the server, not after accessing the server using SFTP. Ideas why? Done on purpose and should I only upload via media uploader and just now add uploads folder content to repo and not have it ignored maybe?

---

## Post 2 by @cfx — 2016-08-23T13:03:59Z

Why not use a nice [uploads sync playbook](https://discourse.roots.io/t/pushing-or-pulling-uploads-with-trellis/4177)?

---

## Post 3 by @swalkinshaw — 2016-08-23T13:29:29Z

You can also do a two/three step process:

1. SFTP uploads to `/home/admin/uploads`
2. SSH in as `admin`
3. `sudo su` (use your admin pw) to become `root`
4. `chown -R web:www-data /home/admin/uploads`
5. `su web` (now you’re the `web` user)
6. Move/copy uploads to proper dir now

edit: or some variation of that.
