Skip to content

Instantly share code, notes, and snippets.

@anavdesign
Created January 19, 2019 20:05
Show Gist options
  • Save anavdesign/0022f247fa69c1373269881cfb304ee1 to your computer and use it in GitHub Desktop.
Save anavdesign/0022f247fa69c1373269881cfb304ee1 to your computer and use it in GitHub Desktop.
Drupal: Site Sync

Drupal Site Sync Sync

Sync Site Files

Copy local site files to remote server

# Add --delete flag ro remove any files not on source
$ drush rsync @self:%files @live:%files --delete

Sync Database

  1. Drush

    $ drush sql-sync @self @live
    
  2. SCP

    1. Local - CD into the the Drupal site folder

      $ dsd ../BACKUP/PATH/ DBBACKUPNAME
      
    2. Copy Database to Remote Server

      scp ../DATABSE/PATH/DATABSE.sql alias:/REMOTE/PATH
      
    3. Remote - Import Database

      $ drush sqlc < ../PATH/TO/DATABSE.sql
      $ drush updb
      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment