Automated MySQL Backup Tool Based on PHP and Perl

MySQL is one of the most popular databases in the world. This database can be installed on Microsoft Windows or Linux platforms. Why is this database so popular? Because it has powerful features and is free. As a database administrator, Backup – database backup is really important to protect the system. It will minimize the risk if something happens to the database.

MySQLDumper: PHP and Perl Based MySQL Database Backup Tool

Since MySQL is a popular database, there are many software that we can use to backup Mysql automatically. From console software to web-based software. But in this article, I will guide you to use MySQLDumper to backup/restore MySQL automatically.

What is MySQLDumper?

MySQLDumper is an open source web-based tool for backing up MySQL databases. It is built from PHP and Perl and can easily dump and restore MySQL data. It is especially suitable for shared hosts, where we do not have access to the Linux shell.

Features of MySQLDumper

There are many features of MySQLDumper, but here are a few that might interest you.

  • Easy to install; just make sure you have a working web server and point your browser to the MySQLDumper installation file.
  • All parameters are displayed before starting backup; so you are sure what you are doing.
  • Database-Overview; Allows viewing of running processes.
  • SQL-Browser: Access your MySQL-Tables, delete tables, edit or insert data.
  • Two ways of backing up, using PHP or Perl.
  • Complete log files.
  • Automatically delete files of your old backups.
  • Create protected folder.

Install MySQLDumper in Linux

Installing MySQLDumper is very easy. First we need to download MySQLDumper here.

At the time of this writing, the latest version is 1.24. So download the latest version in your working web server directory (ie /var/www or /var/www/html). After downloading, you can extract MySQLDumper1.24.4.zip with the following command.

unzip MySQLDumper1.24.4.zip

Then you will find ‘msd1.24.4’ folder. This directory contains all the MySQLDumper files. Next step, you just need to point your browser to the MySQLDumper installation file ‘msd1.24.4/install.php’.

1. Select the installation language.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 33

2. Fill in some login information like MySQL server name, user and password.

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 34

3. You can test the connection to the database by clicking the . button Connect to MySQL. If it succeeds, then we should see a message saying “Database connection was established“.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 35

4. When you get the notification, click the ‘Save‘ and continue with the installation. You will be taken to the main screen.

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 36

How to use MySQLDumper

The main function of MySQLDumper is to backup your MySQL database. With this application, backing up (and restoring) MySQL databases is very easy.

Backup Process – Backup MySQL with PHP

The function menu is located on the left navigation panel. First, we need to select the database that we want to back up. You can see the options on the left menu.

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 37

In the above screenshot, I choose to backup the database named ‘employees‘.

Then select the ‘Backup’ menu on the left. Then select ‘Backup PHP’. We will have a screen like this.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 38

Then click ‘Start New Backup‘. The progress of the backup will be shown to you.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 39

After the backup is complete, we will see a message.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 40

Backup procedure using Perl

Another backup method supported by MySQLDumper is ‘Backup Perl’. In this way, we will use Perl as a fallback tool.

Note: your web server must support ‘perl/CGI’ scripting before using this method. Otherwise you will get an error like this when you click the Test Perl button.

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 41

Similar to the PHP backup method, we need to select the database we want to backup. Then select the Backup menu from the left navigation panel. Then click the Backup Perl button.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 42

MySQLDumper will show you some active parameters at the bottom. Then we can click the ‘Run the Perl Cron‘. Using this way we will not see any progress bar appear. The duration of this backup will depend on the database. If there are no errors, then we will see a message like this.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 43

Process of Restore – Restore

Restoring backups is also very easy using MySQLDumper. You can click on the menu ‘Restore‘ from the navigation panel on the left. All backups are available at the bottom of the restore page.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 44

You can choose 1 backup from there. Above is the selected backup ready to restore. If you want to do a full restore, click the ‘Restore’ above. If you only want to restore some tables, click “Choose tables“.

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 45

Once done, click ‘Restore‘. Just wait a moment for the restore progress to complete.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 46

Create Directory Protection

By default, MySQLDumper’s homepage can be accessed by anyone who knows its URL. Using Directory Protection, we can create a layer of password protection. This Directory Protection uses the ‘.htaccess’ function on the Apache web server.

To create it, just click the button Create directory protection on the main screen.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 47

You will then be asked to provide some authentication information.

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 48

When you’re done with that, click the button Create directory protection. Then you need to confirm again.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 49

If there are no errors, a success message will be displayed.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 50

Next time you visit the site, MySQLDumper will ask you for the password first.

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 51

Manage backed up data

This menu is used to maintain all available backups and restores.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 52

Here are some activities that can be done in this page.

  • Delete the backup; use the Delete buttons at the top.
  • Download backups; Click on the backup name.
  • Select backup; Click on the Database name in All Backups.
  • Upload a large backup to restore.
  • Convert the database to MySQLDumper (MSD) format.

Note: When we convert database without using any compression technique, we will see MySQLDumper create database with name ‘part_1.sql’. The size is smaller than the original.

SQL-Browser

If you want to run a specific SQL command, you can do it in this SQL-Browser page. But it’s best to know what you’re doing.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 53

Configuration

All of the above functions can be configured from the Configuration menu. Here are some sections that we can configure.

GeneralMySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 54

Interface

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 55

Autodelete

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 56

Email

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 57

FTP

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 58

CronscriptMySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 59

Log Management

MySQLDumper also provides basic logs for you. So you can know when a backup-restore operation occurs. To access the log page, simply click on the ‘Log’ menu from the left navigation panel.

There are three types of logs: PHP-Log, Perl-Log and Perl-Complete Log.

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 60

MySQLDumper: Automatic MySQL Backup Tool Based on PHP and Perl 61

MySQLDumper: Automated MySQL Backup Tool Based on PHP and Perl 62

Conclude

MySQLDumper may not be the best backup tool for MySQL. But with the ease of use of this app, everyone can start using it. However, I found that MySQLDumper is not equipped with offline documents. But it’s still a great tool for backing up MySQL databases.

In addition, you can also backup and restore MySQL with the command here.

Leave a Reply