# Files to upload to ftp

**URL:** https://discourse.roots.io/t/files-to-upload-to-ftp/4136
**Category:** sage
**Tags:** gulp
**Created:** 2015-06-28T20:04:46Z
**Posts:** 11

## Post 1 by @mattia — 2015-06-28T20:04:46Z

Which files and folders I have to upload to the FTP, after i run gulp --production?

---

## Post 2 by @austin — 2015-06-28T21:38:11Z

The `dist/` folder. Ignore node\_modules, bower\_components, and assets

---

## Post 3 by @kalenjohnson — 2015-06-28T22:29:39Z

If you are handing this off to the client, then I would suggest also uploading the assets directory.

---

## Post 4 by @mattia — 2015-06-28T22:34:23Z

i have to upload all the files in the root? (gulpfile.js, bower.json, package.json, [CONTRIBUTING.md](http://CONTRIBUTING.md), readme ecc)

---

## Post 5 by @austin — 2015-06-29T01:26:47Z

Nope. Pretty sure you can just whitelist the php files in the root

---

## Post 6 by @dhuyvetter — 2015-07-17T16:39:50Z

Wouldn’t you need the templates folder as well?

---

## Post 7 by @erikkowalski — 2015-07-17T17:02:32Z

I use the following rules when syncing:  
 ![](https://discourse.roots.io/uploads/default/original/2X/c/ca4b1e6e488f5c1568bb2489719d2912b7fd4074.png)

---

## Post 8 by @austin — 2015-07-18T14:51:56Z

> [@dhuyvetter](#):
>
> Wouldn’t you need the templates folder as well?

Oh yes this too. I should have just said “whitelist all your template files”

---

## Post 9 by @AmirFarid — 2018-06-27T00:59:34Z

i know this is an old thread but it seemed the most relevant and I couldnt find an answer…

I am doing a client site which is on shared hosting hence I have to manually SFTP. Using he latest sage build too.

SO, which folder should i be uploading and which should I be missing?

Currently uploading the following:

```
app - all folders and file inside this directory
config - all folders and file inside this directory
dist - all folders and file inside this directory
resources - all folders and file inside this directory (i have a feeling i shouldnt upload this as it contains all my sourcemaps!)
vendor - all folders and file inside this directory - is this required?
```

can someone please give some clrification? thanks in advance…

---

## Post 10 by @knowler — 2018-06-27T01:22:24Z

After running `yarn build:production` and `composer install --no-dev`, bare minimum you’ll want:

```
├── app/
├── config/
├── dist/
├── resources/ # Notice the lack of assets/ within here
│ ├── views/ # Blade templates
│ ├── functions.php
│ ├── index.php
│ ├── screenshot.jpg
│ └── style.css
├── vendor/ # Composer dependencies
└── LICENSE.md # Required (read it)
```

As I said, this is the technical bare minimum. It could be helpful to include the source/build files for whoever picks it up in the future. In my situation I want to encourage teammates to do things the right way (i.e. use version control for the codebase).

I have a bash script that I have run with `yarn prep` that builds for production and then packages these into an zipped folder, which I have labeled `[theme-name]-distribute-[timestamp]-[commit hash]`. It also includes some version details and instructions inside if someone stumbles upon the theme in the future. This allows me to stay sane whilst using FTP.

> **Prep script for Sage 9**
>
> Where `yarn prep` is `yarn build:production && ./bin/prep.sh` and `./bin/prep.sh` is:
> 
> ```
> #!/bin/bash
> 
> # Get theme name
> theme=${PWD##*/}
> 
> echo "Preparing $theme..."
> 
> # Get short hash of current commit
> hash="$(git rev-parse --verify HEAD --short)"
> 
> # Get timestamp
> timestamp="$(date '+%s')"
> 
> # Create temp directory
> temp=".prep/$theme-$timestamp-$hash"
> mkdir -p $temp
> 
> # Copy relevant files to the the directory
> cp -R {app,config,dist,resources,vendor} $temp # Theme setup & config, views, theme files, composer deps, & repo
> rm -rf $temp/resources/assets # Remove source assets
> cp LICENSE.md $temp # Copy Sage license (legally required)
> 
> # Create build(er) info and instructions file
> printf "A theme by Example (example.com)\n\nCommit: $hash\nBuilt at: $timestamp\nBuilt by: $(git config user.name)\n\n" > $temp/example.md
> cat bin/instructions.md >> $temp/example.md
> 
> # Set distribute file name
> dist="$theme-distribute-$timestamp-$hash".zip
> 
> # Compress distribution
> cd .prep
> zip -qr $dist "$theme-$timestamp-$hash"
> 
> # Remove temporary theme directory
> rm -rf $theme
> 
> # Relocate distribution and current working directory
> mv $dist ..
> cd ..
> 
> echo "Finished!"
> ```
> 
> Probably could use some improvements, but it does the trick.

---

## Post 11 by @AmirFarid — 2018-06-27T01:36:09Z

Thank you :slight_smile: super quick reply.

Thanks for the clarification. I have deleted files from resources (phew) and also uploaded the license.md :slight_smile:

Issue sorted.

Nice little bash script. that will be super useful on the next build. currently, don’t have anyone else working on this project but the next one there will be so it will come in handy :-):grinning:
