Information for: DEVELOPERS   PARTNERS

Transferring files to a different docroot

In various circumstances, users will want to copy files to a different environment. Other applications may share a single server in standalone or multisite configurations, which can require several docroot directories on the same server. You can also use the rsync command to complete file transfers in this situation.

To transfer files to a different, local application, complete the following steps:

  1. Create a private key on your local computer.

  2. Add the public key to an account that has team lead permissions on the source server.

  3. Copy the private key to the .ssh directory in the destination directory.

  4. Set the .ssh directory permissions by using the following command:

    chmod 700 .ssh

  5. Use the following command to set the private key file permissions:

    chmod 400

  6. Run your rsync command. For example, the following is an rsync command between docroot directories on the same server:

    rsync -avz -e "ssh -i /home/sourcedocroot/.ssh/id_rsa_rsync"  [email protected]:/mnt/gfs/ /mnt/gfs/


Setting up the SSH keys between applications is also a method to help enable SSH tunneling between servers, or between your server and an external application. For more information, see the SSH tunneling for server-side applications Acquia Knowledge Base article.