Drupal: How to Create Backup of Site Files
This article would tell you how to create backup of your Drupal-based site in different ways:
- Using Unix command (you will need SSH-access for this)
- Through site control panel
- Downloading files by FTP from server
Using Unix command
- Connect to server
- Create compressed gz file:
$ tar -zcvf project.tar.gz project
(This will create compressed file `project.tar.gz’ of `project’ folder content)
Through site control panel
Hoster can provide tools for creating back up site copies.
Download files by FTP from server
If you couldn’t pack files on server, then you will need to download files as they are. This will take you long time!..
You will need to use FTP-client. In the application, you should select folders & files you wish to copy on your PC.
Note:
Database is changed more often than site files. So you can use synchronization method for making backup copy.
Files Synchronization
The point is that files are stored on local PC and server and all changes re made both on PC & Server at the same time.
Site files are changed not so often as database so admin should make changes both on local copy and on server. Then it is necessary to archive local copy with the latest changes and store it with other backup copies.
Here are files which are often changed on server:
- files in /files (Drupal 5) folder and /sites/default/files (Drupal 6)
Changes Control
It is a good idea to track changes. For example, log all file changes in text file. You can also use some version control system such as CVS, SVN etc.