Mantis Logo
Mantis Manual
Manual
Installation

Requirements
Backups
Upgrading
CVS Integration
Uninstall


Partner Links


Backups
Last Modified: July 17, 2005 21:07PM
(Any)
Description

It is recommended to backup your Mantis database on a regular basis. This is easy to accomplish using the mysqldump command:

mysqldump -u<username> -p<password> <database name> > <output file>

To restore a backup you will need to have a clean database. Then run:

mysql -u<username> -p<password> <database name> < <input file>

You can also perform both of these tasks using phpMyAdmin

A good idea is to make a backup script and run it regularly through cron or a task scheduler (for Windows see WinCron). Using the current date in the filename can prevent overwriting and make cataloguing easier.

!!! Backups should always be performed before an upgrade !!!

Make sure to backup Mantis code (which includes your configs + possibly customization), bug attachments / project documents, and database contents.

User Contributed Notes
Backups
Add Notes About Notes
mantis@exozet.com
05-Jan-2004 1:21
#44
If you like to restore the database the command combination will produce an error because the tables allready exists.
So add '--opt' to the mysqldump command and '--force' to the mysql command. (--force because of the commands for mysql 4, they will produce warnings on 3.x and the command will exit)
The '--opt' adds the 'DROP TABLES' command (and some other things) so that you can overwrite existing data with the dump.

create backup:
mysqldump --opt -u<username> -p<password> <database name> > <backup file>
restore backup:
mysql --force -u<username> -p<password> <database name> < <backup file>
Add Notes About Notes
Last updated: Fri, 16 May 2008 - 11:12:00

Mantis @ SourceForge