Date Published: October 28, 2024
Why does my application have folders named .acquia_files_moved inside docroot/sites/[sitename]?
Symptoms¶
Files that have been committed onto the Git repository under the paths docroot/sites/*/files are not present on the deployed code artifact (when observed via an SSH or SFTP session).
Additionally, folders named ".acquia_files_moved" that are not present in the Git repository seem to have appeared on the deployed code, and contain the original contents of those 'files' folders.
Note: these .acquia_files_moved folders begin with a . (dot) character, and therefore may be hidden unless you are running a shell command (or using an SFTP option) that shows hidden files and folders.
Cause¶
As documented elsewhere, the storage and management of files is kept separate from code.
- Under the Acquia Cloud Platform, the Drupal 'files' folders (usually present at docroot/sites/*/files) are symbolically-linked to the writable shared filesystem which the various webservers / pods connect to.
- Code on the application pods comes from the Git repository, and is non-writable by the webservers' / pods' processes for security. On the platform, these special "Drupal files" folders are
To accommodate cases where a developer is not aware of this separation, and has committed 'Drupal files' from the above folder paths into the Git repository, the platform renames those docroot/sites/*/files folders into docroot/sites/*/.acquia_files_moved . This then allows the deployment process to ensure it can create the needed docroot/sites/*/files as a symlink to the proper path in the shared filesystem.
Resolution¶
If you see .acquia_files_moved folders in your application, here are some options:
- Reconsider your application's architecture based on the above description of how code and Drupal files are separated.
- You can choose to copy the files from the .acquia_moved_folder into the shared filesystem directly, within an SSH session.
- You can also opt to remove these files and the 'files' folders from your Git repository entirely. You should verify that your .gitignore file in your Git repository is set up to ignore all docroot/sites/*/files folders.
Note that keeping the Git repository small makes code deploys faster and helps keep the Git repository size under the Acquia Cloud platform limits. You should also think of completely erasing the Git history surrounding these files folders, which also reduces the Git repository size.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.