Roots Discourse

Sync Script Not Syncing

Hello All. I’ve just deployed my first staging site with Trellis, Bedrock and Sage and I’m struggling to get the Sync Script plugin to work. Every time I try to sync from Development to staging it says it has connected to development and then successfully connected to staging but once it has finished nothing appears to have changed… Here are the files I’ve modified:

At the top of sync.sh:

DEVDIR="web/app/uploads/"
DEVSITE="http://mysitename.test"

PRODDIR="web@mysitename:/srv/www/mysitename.co.uk/shared/uploads/"
PRODSITE="https://mysitename.co.uk"

STAGDIR="web@staging.mysitename.co.uk:/srv/www/staging.mysitename.co.uk/shared/uploads/"
STAGSITE="https://staging.mysitename.co.uk"

In wp-cli.yml:

path: web/wp
server:
  docroot: web

@development:
  ssh: vagrant@mysitename.test/srv/www/mysitename.co.uk/current
@staging:
  ssh: web@staging.mysitename.co.uk/srv/www/staging.mysitename.co.uk/current
@production:
  ssh: web@mysitename.co.uk/srv/www/mysitename.co.uk/current

Doesn’t seem to update the media folder or the database on the staging site when I run:

./sync.sh development staging

So I’ve ended up doing it manually which defeats the point, obviously… I know I’m doing something wrong but can’t seem to figure it out… Any help greatly appreciated.

  1. What are you using for your dev environment? Vagrant or local?
  2. Do the wp cli aliases all work if you run them in a terminal?
  3. Is the staging site up and running yet? ie have you provisioned and deployed and then done the “5 minute install”?

Does a manual invocation of ssh web@staging.mysitename.co.uk actually work, can you connect?
And can you then cd into /srv/www/staging.mysitename.co.uk/shared/uploads/?
Can you write to it, e.g. does touch test work?

Also take a look at the sync.sh. All its commands can be also run manually. I am not sure what sync script you are using, is there a verbose option?

Thanks @ng3 and @strarsis - all of your suggestions worked fine and so I just shut down vagrant, started it up again and ran another deploy and then it all worked fine. It must have been something I did (or forgot to do) at my end, so thank you for your suggestions - much appreciated. M