Book Image

Drush for Developers - Second Edition

By : Juan Pablo Novillo Requena, Juan P Novillo Requena
Book Image

Drush for Developers - Second Edition

By: Juan Pablo Novillo Requena, Juan P Novillo Requena

Overview of this book

Table of Contents (13 chapters)
Drush for Developers Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Keeping Database Configuration and Code Together
Index

Copying database and files between environments


Now that we have our site aliases configured, we can benefit from running two of the most powerful Drush commands: sql-sync and core-rsync. The former is used to copy the database from a Drupal project to another, while the latter copies files between Drupal projects. In this section, we will see some suggestions to make them safer and efficient in our projects.

Previously in this chapter, we have seen examples of both these commands. They take two site aliases as arguments. The first one is the from (also known as source) and the second one is the to (also known as destination). I like to mentally tell it to myself when I type these commands so that I make sure that I copy them in the right direction. I mumble drush sql-sync from to. The reason for such thoroughness is that when running core-rsync and sql-sync commands, the order does matter a lot. Here is an example: while working in a development team, we would run these commands every once...