Files syncing with Drupal
Published
Reviewed
Drupal keeps uploads in web/sites/default/files. That folder is not in Git and deployments leave it alone, so sync it on its own with the frbit CLI.
Install and deploy run down
- Install Drupal locally
- Deploy Drupal to fortrabbit
- Database syncing
- Files syncing ← you are here
Files down
Run it from the project root:
frbit files pull web/sites/default/files -e {{app-env-id}}
Changed files are overwritten locally. Add --dry-run to see what would change, --delete to also remove local files that are gone on the environment.
Files up
frbit files push web/sites/default/files -e {{app-env-id}}
It asks to type the environment ID first. The software template excludes web/sites/default/files from deployments, so pushed files survive the next deployment.
Without the frbit CLI
Both commands wrap rsync over SSH. The same with plain rsync:
# Down
rsync -av {{app-env-id}}@ssh.{{region}}.frbit.app:web/sites/default/files/ ./web/sites/default/files/
# Up
rsync -av ./web/sites/default/files/ {{app-env-id}}@ssh.{{region}}.frbit.app:web/sites/default/files/