Home WebServer PanelDirectAdmin Backup the entire database on DirectAdmin with CustomBuild 2.0

Backup the entire database on DirectAdmin with CustomBuild 2.0

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

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:

AZDIGI Tutorial
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:

AZDIGI Tutorial
cat /usr/local/directadmin/custombuild/options.conf | grep mysql_backup_dir
    

Here are my results:

Screen Shot 2020 07 24 at 4.06.20 PM

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.

Screen Shot 2020 07 24 at 4.11.35 PM

Checking the list of files in this directory, we will see 2 databases similar to the above log.

Screen Shot 2020 07 24 at 4.56.57 PM

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:

AZDIGI Tutorial
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:

Screen Shot 2020 07 24 at 4.59.45 PM

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:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign