---
title: "rsync and Drush with Windows"
date: "2024-02-14T06:18:38+00:00"
summary: "Streamline Drupal development on Windows with Drush and rsync. Learn to configure aliases, sync files, and optimize your workflow for efficient site management and updates."
image:
type: "page"
url: "/acquia-cloud-platform/rsync-and-drush-windows"
id: "8c3da231-6bcb-45e4-aaf4-4a87246e9f55"
---

[Drush](http://www.drupal.org/project/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.

Note

*   If you are using a Unix-based system for development, see [rsyncing files on Cloud Platform](/acquia-cloud-platform/manage-apps/files/transfer-files/rsync) for Unix-specific directions.
*   The [current Drupal version](/service-offerings/guide/software-life-cycle#supported-drupal-version) requires Drush version 11 or later. Newer versions of Drush, that is, version 11 and later, must be installed via Composer. Acquia does not manage the update to the newer versions. For more information, see [About Drush on Cloud Platform](/acquia-cloud-platform/manage-apps/command-line/drush).

Configuring Drush aliases
-------------------------

Drush aliases make it easier to direct where and what websites Drush needs to work with.

1.  [Sign in to Cloud Platform user interface](/node/55875).
2.  [Download your Drush aliases](/acquia-cloud-platform/manage-apps/command-line/drush), 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.php
    
3.  Edit 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', );
    
4.  Save the file.
5.  Verify your site aliases are functioning properly using the following command to return a list of available aliases:
    
        drush sa --full
    

### Manual rsync of all files

If 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.local

The `-vd` option displays verbose debugging for troubleshooting. After you have confirmed the command works as you expect, you can remove the `-vd` flag.

### Manual rsync of selected directories

By default, the `drush rsync` command rsyncs both your website’s [code](/acquia-cloud-platform/manage-apps/code) and [files](/acquia-cloud-platform/manage-apps/files/about). 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:%files

For more examples, see [Drush Tip: Quickly Sync Files Between Your Environments With Rsync](http://soundpostmedia.com/article/drush-tip-quickly-sync-files-between-your-environments-rsync).