Nội dung
1. Overview
In some cases, you may want to backup the entire database on DirectAdmin in preparation for upgrading/downgrading MySQL/MariaDB instances, periodic backups and a few more cases…
In today’s article, AZDIGI will show you how to backup the entire database on DirectAdmin with CustomBuild 2.0 with just a few simple steps.
Note: Requirement MySQL/MariaDB database management systems still work properly.
2. Backup the entire database on DirectAdmin with CustomBuild 2.0
To backup the entire database on DirectAdmin, follow these steps:
Step 1: SSH into your DirectAdmin system
To back up the entire database on DirectAdmin, we first need to SSH or access your VPS/server with root privileges. If you do not know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH-ing, we continue with step 2 to start the process of backing up the entire database on DirectAdmin with CustomBuild 2.0.
Step 2: Backup the entire database on DirectAdmin with CustomBuild 2.0
First, we need to check if the version of CustomBuild we are using is 2.0 or not. To check the version of CustomBuild you are using, please check out the following short tutorial:
In case your CustomBuild version is lower than 2.0 then you need to upgrade CustomBuild 1.x to 2.0 , you can check out the following tutorial:
After having CustomBuild 2.0, run the following commands:
cd /usr/local/directadmin/custombuild ./build set mysql_backup yes ./build mysql_backup
Explanation of the above commands:
- Command 1: Move to custombuild folder.
- Command 2: Adjust the configuration to enable database backup.
- Command 3: Launch the database backup process.
If you do not know where the mysql_backup
directory contains the databases, you can use the following command:
cat /usr/local/directadmin/custombuild/options.conf | grep mysql_backup_dir
Here are my results:
So the directory containing the backed-up databases will be /usr/local/directadmin/custombuild/mysql_backups
. Depending on the configuration in the /usr/local/directadmin/custombuild/options.conf
file, it may be different on your VPS/server.
Or you can also change this path by reusing the configuration options.conf
file if you want.
Since I only have one user demo2
with the demo2_test
database, when I run the ./build mysql_backup
command , the process is speedy, and only 2 databases are generated, including a default database.
Checking the list of files in this directory, we will see 2 databases similar to the above log.
In case your mysql_backups
directory already exists data and you do not want it to be overwritten, you can change the current directory name with the following command:
mv mysql_backups mysql_backups.`date +%F`
After running this command, the directory name mysql_backups
will be changed to a new name of the form mysql_backups.YYYY-mm-dd
as shown below:
So the process of backing up the entire database on DirectAdmin has been completed.
3. Summary
AZDIGI has completed the steps to back up the entire database on DirectAdmin as well as change the database path to be backed up. Hope this article will be helpful to you.
Wishing you success.
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com