This article is about taking a backup of your database and is intended for clients who have PHPMyAdmin installed on their Hostwinds Shared Hosting, Business Hosting, Cloud, VPS or Dedicated Server account. Before making any changes to your databases or updating your applications, or making any significant changes, it is important to always take a backup. Hostwinds suggests taking a backup of your database frequently so that you can easily restore your database at any time and in case anything goes wrong.
How To Backup Your Database using cPanel and PHPMyAdmin
- Login into your cPanel Account
- Navigate to the Databases section and click phpMyAdmin
- Click on the database name on the upper left side of the page that you would like to create a backup for
- Click on Export in the top middle part of the page
- Select the Export method that you would like to use, the format and click the Go button
- This will create the backup file and download it to your computer so that you have a backup.
Backup Database Using Cron
- Login to your cPanel Account
- Scroll down to the Advanced Section > Click on Cron Jobs
- Scroll down to the Common Settings
- Select the frequency to create your database backups, or enter this in manually
- Enter in the Command to run to backup your databases
1mysqldump --opt -Q -u [cPanelUserName] -p[cPanelPassword] --all-databases > /home/[cPanelUsername]/[FILE_NAME]_`date +\%d\%m\%y`.sqlReplace the following in the above cron job with your account specific details:
- Click the Add New Cron Job button
Once this cron job has been created, you can check and confirm that the file exists in your home directory and that everything is working as expected.
- Backup and Restore MySQL Databases Using mysqldump – Use command line to make backups and restore your database from a backup