Back up ZenTao
- 2016-10-24 11:20:00
- azalea
- 9116
- Last edited by xiying guan on 2018-12-06 10:10:21
One important job of ZenTao administrator is to back up ZenTao regularly, so it be recovered on time once any system failures occurred. In the following part, we will see how to back up ZenTao.
ZenTao backup will be divided into four parts, configuration files, codes modified, database and attachments. Now let’s see how to back up in different environment.
1. Back up through one-click installation package
If you use the one-click installation package, the simplest way is to back up the directory of the entire installation package. For a complete backup, you should stop Apache and MySQL before backup.
Back up the entire directory of xampp for Windows one-click installation package and /opt/lamp for Linux one-click installation package.
2. Manual backup
2.1 Back up configuration files, codes and attachmentConfiguration files are saved in zentao/config/my.php, attachments in zentao/www/data/ and codes mofied in zentao. So the way to back up configuration files, codes and attachments is to back up the entire directory of ZenTao.
2.2 Back up database
2.2.1 Back up original database files
Find data directory of mysql. It is usually installed in the directory of mysl in Windows or in the directoty of /var/mysql or /var/db in Linux.
In the directory data, there is a directory of zentao, where the original database files are saved. So you can copy this entore directory. In Linux, you have to pay attention to privilege.
2.2.2 Back up files through exporting
Export databse by management tools provided in mysql, mysqldump -u
XXX -p zentao or zentao.sql.
XXX can be changed into actual users.
3. Log in ZenTao Admin to back up
Administrators log in ZenTao and go to Administration-> Backup and click the Backup Button to back up ZenTao.
4. Back up by the backup scripts provided in ZenTao
init.bat and
init.sh have been included in ZenTao 4.0+ to initialize the scripts for management. One of them is used to back up the database and attachments with the name of
backup.bat (for Windows) or
backup.sh (for Linux). First please refer to 8.1.1 Initialize Scripts to initialize all the scripts. Then switch to the directory of zentao/bin/ to execute backup.bat or backup.sh.
Execute backup.bat in Windows.
I:\xampp\zentao\bin>gt;backup.bat I:\xampp\zentao\bin>gt;i:\xampp\php\php.exe I:\xampp\zentao\bin\php\backup.php Backuping database, successfully saved to I:\xampp\zentao/backup/201304/db.20130402.zip Backuping files, successfully saved to I:\xampp\zentao/backup/201304/file.20130402.zip
Execute backup.sh in Linux.
./backup.sh Backuping database, successfully saved to /mnt/data/z/pms/backup/201304/db.20130402.zip Backuping files, successfully saved to /mnt/data/z/pms/backup/201304/file.20130402.zipOnce backed up, the database and attachments should be named after dates and saved to the directory of zentao/backup.
Notes: If mysql service is stopped, the data in mysql can not be backed up.