To copy a large number of files from one place to another, one of the better options is to use rsync, which provides either an interactive or non-interactive way to copy files from one location to another on a single infrastructure, or from one infrastructure to another.
-n option with each rsync command, which gives you an output of the changes without committing them. You must add the -n option to the commands in the following steps.To rsync files on Cloud Platform:
/mnt/files/[site]/files-private/private_key directory, where [site] is the website’s name on Cloud Platform. For more information about placement, see Storing private information in the file system.To allow access to the key, give it the proper permissions by using a command similar to the following:
chmod 600 /mnt/files/[site]/files-private/private_keyExecute the rsync command from either of the production infrastructure:
rsync -rltDvPh -e "ssh -i [path to private key]" [source] [destination]If you are using Drush and aliases to download files, you can use a command like this:
drush rsync @mysite.dev:%files sites/defaultTransfer the files folder from staging to production:
rsync -rltDvPh -e "ssh -i /mnt/files/[site]/files-private/private_key" [user].[env]@[stage_infrastructure]:/mnt/files/[stage_name]/sites/default/files/ /mnt/files/[site]/sites/default/filesIn this example, [stage_name] is the name of the staging website’s name on Cloud Platform, and the [stage_infrastructure] is the name of the staging infrastructure on Cloud Platform.
The rsync flags ensure all the files copy recursively, and preserve both modification times and symlinks. For more information on the rsync options used here, see the rsync man page.
The following examples give information on how you can extend or update rsync commands to meet your needs.
To transfer the files folder from your production environment to your staging environment, execute a command similar to the following:
rsync -rltDvPh -e "ssh -i /mnt/files/[site]/files-private/private_key" /mnt/files/[site]/sites/default/files/ [user].[env]@[stage_infrastructure]:/mnt/files/[stage_name]/sites/default/files/To remove and replace files with a new copy, execute a command similar to the following:
rsync -rltDvPh /mnt/files/[site]/sites/default/files/ /mnt/files/[site]/sites/default/files --deleteYou can also use SCP over rsync from a local machine to transfer files between two remote . You may need to set up SSH keys between the two infrastructures:
scp -r -P22 [user].[env]@[svr].hosting.acquia.com:/mnt/files/[site]/sites/default/files/ [user].[env]@[svr].hosting.acquia.com:/mnt/files/[site]/sites/default/filesIn this example, [user] is your username, and [svr] is the name of the particular infrastructure you’re moving data to or from.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
To copy a large number of files from one place to another, one of the better options is to use rsync, which provides either an interactive or non-interactive way to copy files from one location to another on a single infrastructure, or from one infrastructure to another.
-n option with each rsync command, which gives you an output of the changes without committing them. You must add the -n option to the commands in the following steps.To rsync files on Cloud Platform:
/mnt/files/[site]/files-private/private_key directory, where [site] is the website’s name on Cloud Platform. For more information about placement, see Storing private information in the file system.To allow access to the key, give it the proper permissions by using a command similar to the following:
chmod 600 /mnt/files/[site]/files-private/private_keyExecute the rsync command from either of the production infrastructure:
rsync -rltDvPh -e "ssh -i [path to private key]" [source] [destination]If you are using Drush and aliases to download files, you can use a command like this:
drush rsync @mysite.dev:%files sites/defaultTransfer the files folder from staging to production:
rsync -rltDvPh -e "ssh -i /mnt/files/[site]/files-private/private_key" [user].[env]@[stage_infrastructure]:/mnt/files/[stage_name]/sites/default/files/ /mnt/files/[site]/sites/default/filesIn this example, [stage_name] is the name of the staging website’s name on Cloud Platform, and the [stage_infrastructure] is the name of the staging infrastructure on Cloud Platform.
The rsync flags ensure all the files copy recursively, and preserve both modification times and symlinks. For more information on the rsync options used here, see the rsync man page.
The following examples give information on how you can extend or update rsync commands to meet your needs.
To transfer the files folder from your production environment to your staging environment, execute a command similar to the following:
rsync -rltDvPh -e "ssh -i /mnt/files/[site]/files-private/private_key" /mnt/files/[site]/sites/default/files/ [user].[env]@[stage_infrastructure]:/mnt/files/[stage_name]/sites/default/files/To remove and replace files with a new copy, execute a command similar to the following:
rsync -rltDvPh /mnt/files/[site]/sites/default/files/ /mnt/files/[site]/sites/default/files --deleteYou can also use SCP over rsync from a local machine to transfer files between two remote . You may need to set up SSH keys between the two infrastructures:
scp -r -P22 [user].[env]@[svr].hosting.acquia.com:/mnt/files/[site]/sites/default/files/ [user].[env]@[svr].hosting.acquia.com:/mnt/files/[site]/sites/default/filesIn this example, [user] is your username, and [svr] is the name of the particular infrastructure you’re moving data to or from.
If this content did not answer your questions, try searching or contacting our support team for further assistance.