With Copilot
Acquia Copilot is a conversational AI connected into our product documentation and knowledge base. Ask Copilot about product features, technical details, troubleshooting and how to get started with Acquia products.
Sign in to use Acquia Copilot
Drush is one of the most useful tools a Drupal developer or site builder can have in their arsenal. On Unix-based systems, it is reasonably straightforward to set up and get started using. Windows users have a more involved setup.
Drush aliases make it easier to direct where and what websites Drush needs to work with.
Download your Drush aliases, and follow the instructions on that page to extract the file into the proper directory on your local machine. If the directory does not exist, you may need to create it.
When the Drush aliases are saved properly, the path to the aliases file should look like this, where username is your Windows username:
c:\Users\username\.drush\sitename.aliases.drushrc.phpEdit the aliases file and add this array entry at the top, changing any details to match your local Drupal website setup:
// Site sitename, environment local
$aliases['local'] = array( 'site' => 'sitename', 'env' => 'loc', 'uri' => 'localhost:8082:', 'root' => 'c:/Users/username/Sites/mysite', );Verify your site aliases are functioning properly using the following command to return a list of available aliases:
drush sa --fullIf you need to sync your website’s files manually, use the following command, adapting it where necessary, to rsync your entire development environment to your local computer:
drush -vd --mode=ruLtvz rsync @mysite.dev @mysite.localThe -vd option displays verbose debugging for troubleshooting. After you have confirmed the command works as you expect, you can remove the -vd flag.
By default, the drush rsync command rsyncs both your website’s code and files. If you want to transfer only the files directory, add the following lines to your Drush aliases file, adjusting it to match your actual alias and system file paths:
// Site mysite, environment local
$aliases['local'] = array( 'site' => 'mysite', 'env' => 'loc', 'uri' => 'localhost:8082:', 'root' => 'c:/Users/[username]/Sites/mysite', 'path-aliases' => array( '%files' => 'sites/default/files', ) );With this alias, you can run your working Drush command with the files path alias added, as in this example:.
drush -vd rsync @mysite.dev:%files @mysite.local:%filesFor more examples, see Drush Tip: Quickly Sync Files Between Your Environments With Rsync.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.