Feature request: database backup

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
RobLewis
Posts: 4
Joined: 14 Apr 2005, 03:25
Location: Seattle
Contact:

Feature request: database backup

Post by RobLewis »

Could Mantis' "Manage" panel have an option to back up the MySQL database?
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

It could, but the files might be huge. My test database with embedded files is about 32M.

I use a cron task that runs "mysqldump mantis > ../test.dump". You can also use file rotation with this method as it's automatic.
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

I was against implementing this feature, since it is not a core feature and can easily be done using phpMyAdmin or MySQL directly.

However, if someone contributes a script that does this for ideally all supported DBMSes, I would be willing to include it in the Mantis core. If not all databases are supported, then we can disable this option for the non-supported db types.

I can see that this option can be convenient for users with hosted solutions. However, it can be a security risk if it is not secured properly.

It will be more practical if the scripts supports gz or zip compression, and obviously it will be more usable for users who have the attachments outside of the database.

Users must always remember that they also need to backup their attachments.

Regards,
Victor
MantisConnect
http://www.futureware.biz/mantisconnect/
asupport
Posts: 1
Joined: 06 Jun 2006, 09:20

Backup bd

Post by asupport »

Hi, I use a php script from Pascal Casenove (PHPMySQLBackup that can be found at http://www.comscripts.com)
This adaptation needs no Mantis's code modification, so you can upgrade without loose your custom work!
To store my custom files, I have created a directory 'custom_files', under Mantis intall dir!
So I changed the code of the backup script to use Mantis's variables:

Added line in backup script :
require_once $Path_to_Mantis\include_inc.php # (that contents infos for database)

Modified lines in backup script
$host=$g_hostname;
$base=$g_database_name;
$login=$g_db_username;
$password=$g_db_password;

Finaly, I added in top_include_file.php a test to show a backup button (link to backup script) only if user_access_level = 90 (administrator)
Enjoy!
Paul
lpantos
Posts: 16
Joined: 24 Jan 2007, 16:51

Backup

Post by lpantos »

Quote
I was against implementing this feature, since it is not a core feature and can easily be done using phpMyAdmin or MySQL directly.
Quote

Could I please get instructions on how to backup my database?
Post Reply