Defalto CRM

System Backup (Database and Files)

Estimated reading: 2 minutes 64 views

You can back up your system (database and files) using your hosting control panel or via SSH/console. Backups are usually stored as .tar.gz or .tgz files.

 

1. Backup via Hosting Control Panel

Most hosting providers use panels like cPanel, Plesk, DirectAdmin, ISPConfig, Webmin/Virtualmin, VestaCP, aaPanel or a custom dashboard.

Steps:

1. Log in to your hosting control panel
Open your hosting account and access the control panel provided by your host.

2. Open the Backup section
Look for menu items such as:
Backup, Backups, Backup Manager, Backup Wizard, or Backup & Restore.

3. Create a Full Backup
Full backups usually include:

  • Website files

  • Databases

  • Config files

  • (Optional) Emails

The panel will generate a file like:
backup-2025-01-09.tar.gz
or
full-backup.tgz

4. Download or store the backup
You can save the backup to:

  • Your computer

  • Home directory

  • FTP/SFTP

  • Cloud storage (depending on the panel)

 

2. Backup via Console (SSH)

If you have SSH access, you can manually back up files and databases.

2.1 Backup Website Files (.tar.gz)

Navigate to your website directory and create a compressed backup.

Example directory: /var/www/html

Command (use inside your SSH terminal):

 
tar -czvf website-files-backup.tar.gz /var/www/html

This creates a compressed archive containing all your website files.

2.2 Backup Database (MySQL/MariaDB)

Export a database:

 
mysqldump -u USERNAME -p DATABASE_NAME > database-backup.sql

Export all databases:

 
mysqldump -u USERNAME -p --all-databases > all-databases.sql

Compress the SQL file (optional):

 
tar -czvf database-backup.tar.gz database-backup.sql
 

2.3 Combine Files + Database into One Backup

tar -czvf system-backup.tar.gz /var/www/html database-backup.sql

This gives you a single file containing everything you need.

3. Verifying .tar.gz / .tgz Backups

Windows: Use 7-Zip or WinRAR
Mac/Linux: Use the built-in extractor

4. Restoring a Backup

Via Hosting Panel

Upload the .tar.gz file in the Backup/Restore section of your control panel.

Via SSH

Restore files:

 
tar -xzvf website-files-backup.tar.gz -C /

Restore database:

 
mysql -u USERNAME -p DATABASE_NAME < database-backup.sql
 

5. Recommended Storage Locations

It is best to store backups in more than one place:

  • Cloud storage (Google Drive, OneDrive, Dropbox)

  • External HDD/SSD

  • Remote server (SFTP)

  • Local NAS device

Avoid keeping backups only on the same hosting server.

CONTENTS