There are several options for database backups.

Database Backup Settings

Auto Detect

The backups application will detect configuration files for common CMS installations like WordPress, Joomla, Bulletin, Magento and Drupal. Choose "Auto Detect" for your CMS-based website backup.

No Database

If your site is "static" and doesn't have a database, simply choose "No Database."

Using a Cron Job

If your database is relatively large it may be difficult to successfully back it up using PHP scripts. In this case, you can use a cron job. This can be done via cPanel or SSH using the crontab editor.

This is the cron template that we use:

mysqldump -h'localhost' -u'user' -p'password' db_name | gzip > path_to_public_folder/sucuri-backups/db_name-sucuri-db-dump-gzip-1432041495-"$(echo -n $(date) | md5sum | awk {'print $1'})".gz

You will need to fill in the database connection details and create the folder 'sucuri-backups' in your root web directory and update the path in the template. The frequency of the cron job should be the same as your backup frequency. Ideally the cron job should begin not more than a few hours before the backup and should not run during the backup process. Finally, the database backup settings need to be changed to "Using a cron job" in your backups dashboard.

Database Backup Settings

The backups application takes care of all housekeeping and will delete previous archives after the new one has been downloaded. Using a cron job only requires space on your host server to save one database archive.


If the automatic database backup can't detect your database configuration file, you will need to help us a bit.

You will need to create a file named “sucuri-db-config.php” in your root web directory (where your index.php or index.html is).

The file needs to contain the following:

define('DB_NAME',     '');
define('DB_USER',     '');
define('DB_PASSWORD', '');
define('DB_HOST',     'localhost');

You will need to define the proper values for DB_NAME, DB_USER and DB_PASSWORD with your database name, username and password respectively. Our backup system will use that file and to connect to your database.

For multiple databases support you just need to create a custom file for every extra database. The custom file name is wildcard matched so you can have any name you want that is starting with 'sucuri-db-config':

  ex: sucuri-db-config-blog.php, sucuri-db-config-wiki.php, sucuri-db-config-2.php

That's it!

Your first backup should complete within a few hours (large sites can take considerably longer). You'll receive an email notication when the backup is complete.

If you are still not sure what do, please feel free to open a support ticket with the Sucuri team.