# Uploading production assets to remote server

**URL:** https://discourse.roots.io/t/uploading-production-assets-to-remote-server/5788
**Category:** bedrock
**Tags:** deploys
**Created:** 2016-01-28T06:56:35Z
**Posts:** 8

## Post 1 by @atburi — 2016-01-28T06:56:35Z

I’m managed to set up up a droplet on DigitalOcean that’s working with my local development and am able to run successful deploys to the droplet. My local changes/compiled assets are not being pushed to my remote server. I’m curious why this doesn’t happen by default, and if, by design, I need to ssh into the remote server and re-compile manually every time I deploy?

I read through the thread below which outlines using a capistrano script, but it seems overly complicated when I was hoping my life was going to be simplified! I’m sure there’s a simple explanation to this.

> [@Using Bedrock + Sage to deploy with Capistrano (theme Gulp dist files?)](https://discourse.roots.io/t/using-bedrock-sage-to-deploy-with-capistrano-theme-gulp-dist-files/3325):
>
> I’m able to deploy with Capistrano and all is mostly well. However, my theme (built on Sage) doesn’t have the dist folder and all of the assets etc on the server when I deploy. I could add dist to the git repo and then it would be deployed t o the server that way, but it seems like I should probably be using Capistrano to generate these during deployment or something? How do I configure Capistrano to run gulp --production and deploy the dist directory and all of its assets to my server during a…

Thanks.

---

## Post 2 by @fullyint — 2016-01-28T07:07:13Z

Commit changes to your [repo](https://github.com/roots/trellis/blob/11516d12e42355d0304eb4fb8c15be7ca8fcf6d4/group_vars/production/wordpress_sites.yml#L7) so that the deploy will pull those up-to-date source files.

You can have the deploy sync up your locally compiled assets using [deploy hooks](https://roots.io/trellis/docs/deploys/#hooks), specifically by uncommenting what you need in [`build-before.yml`](https://github.com/roots/trellis/blob/11516d12e42355d0304eb4fb8c15be7ca8fcf6d4/deploy-hooks/build-before.yml), which is already [hooked up](https://github.com/roots/trellis/blob/11516d12e42355d0304eb4fb8c15be7ca8fcf6d4/deploy.yml#L11).

Related: [Build Steps and Deployment](http://austinpray.com/ops/2015/01/15/build-steps-and-deployment.html) from @austin.

---

## Post 3 by @atburi — 2016-01-28T07:24:42Z

@fullyint - thanks for the quick response; appreciate it.

That did the trick. (Maybe this could be explained a bit more in the Trellis docs., or maybe I missed it.)

I assume that plugins files get transferred automatically?  
Is there any way to upload my local database to remote, as well?

---

## Post 4 by @fullyint — 2016-01-28T07:32:16Z

If your repo has a [composer.json](https://github.com/roots/bedrock/blob/2d1bee93540236f4d42a0aa4d55cd57cac47af5d/composer.json) file listing plugins, the deploy will [“Install Composer dependencies”](https://github.com/roots/trellis/blob/11516d12e42355d0304eb4fb8c15be7ca8fcf6d4/roles/deploy/hooks/build-after.yml#L12) (as mentioned in the [default hooks](https://roots.io/trellis/docs/deploys/#default-hooks) section of the docs). If you have private plugins, search discourse for how people are handling those via composer. It’s probably less of a good idea than composer, but you could use deploy hooks to set up additional sync tasks for plugins, like the sync task in `build-before.yml` for compiled theme assets.

Thanks for the feedback regarding the docs. It would be fantastic if you could help us improve the [docs](https://github.com/roots/docs) via pull request. :grin:

---

## Post 5 by @atburi — 2016-01-28T07:42:07Z

Thanks, @fullyint. I’ll see what I can do :slightly_smiling:

---

## Post 6 by @erit — 2016-01-28T16:20:24Z

Sometimes I’ll have a separate script for the uploads dir because I don’t necessarily want to sync them every time I deploy nor do I want them in my repo. Just do what works for your situation :slight_smile:  
Here’s an example: [Pushing or pulling uploads with Trellis](https://discourse.roots.io/t/pushing-or-pulling-uploads-with-trellis/4177)

---

## Post 7 by @atburi — 2016-01-29T05:08:18Z

Makes sense. Thanks, @erit, I’ll take a look.

What do you guys use to sync local and remote databases? Manual exports, wp-db migrate, or can trellis handle it as well?

---

## Post 8 by @erit — 2016-01-29T22:49:36Z

I just use wp-cli which is included in Trellis, scp the file to local and commit to repo, plus weekly server backups. Probably a good idea to set up a script and/or cron for this too.

From what I’ve seen, a lot of people prefer a plugin that does this regularly, like BackupBuddy. I believe wp-db is still a manual process.
