Skip to content

Instantly share code, notes, and snippets.

@markshust
Created December 23, 2020 14:18
Show Gist options
  • Select an option

  • Save markshust/99e22bc3507db876df4a3b8763176aec to your computer and use it in GitHub Desktop.

Select an option

Save markshust/99e22bc3507db876df4a3b8763176aec to your computer and use it in GitHub Desktop.
Helper script to sync dev environments with prod
#!/bin/bash
bin/restart
echo "Restoring database from backup..."
bin/clinotty mysql -h db -u root -pmagento magento < backups/latest.sql
rsync -av username@hostname:/var/www/html/pub/media/wysiwyg/ src/pub/media/wysiwyg/
rsync -av username@hostname:/var/www/html/pub/media/ src/pub/media/ --exclude=import --exclude=tmp --exclude=cache --exclude=captcha
bin/composer install
bin/patch
bin/magento app:config:import
bin/magento setup:upgrade
bin/magento cache:flush
echo "Restore complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment