How To Backup A Website And Restore A Backup In cPanel

This article covers how to backup a website in cPanel, as well as how to restore a backup copy of the data. Backing up your website is a vital part of maintaining its security. Whether you face system failures, security breaches, coding errors, or compatibility issues, having reliable backup data can save you from potential data loss and downtime.

Domains.co.za offers daily website backups with all Web Hosting plans, ensuring your data is always protected. This guide provides essential information on the importance of backups and how to back up your website manually using cPanel.

A Precise Step-by-step Process to Backup a Website in cPanel

For a very precise and accurate backup of your website and restoration of backed up folders and files, please follow the steps below, we are using a WordPress website as an example.

Part 1: Set Preferences to Show Hidden Files

1. In the cPanel Dashboard, scroll down to the Files section and select File Manager a new browser tab will open to the right. 

How to Backup and Restore a Website - cPanel Dashboard

2. Click Settings and the Preferences pop-up window will display.

How to Backup and Restore a Website - cPanel File Manager

3. Tick the Show Hidden Files (dotfiles) checkbox and Save

How to Backup and Restore a Website - Preferences

Part 2: Backup the ETC Folder & Files

4. Select the etc Folder and double-click the Domain Name Folder. (This will be the domain name to be backed up.)

How to Backup and Restore a Website - Select etc Folder

5 Click Select All. Click the Compress icon on the far right of the top menu. 

How to Backup and Restore a Website - Select All & Compress

6. Select Zip Archive and Enter the name of the compressed archive in the text field below, changing the file name to etc. Click Compress Files

How to Backup and Restore a Website - Create a Zip Archive File

7. Compression Results will display in the window. Click Close.

How to Backup and Restore a Website - Compression Results

8. Right click the .zip file and download to your Local Drive in a backup-specific folder of your choice.

Part 3: Backup the MAIL Folder

9. Select the Mail Folder on the left-hand side. Double-click the Domain’s Folder that you are backing up. 

How to Backup and Restore a Website - Mail Folder

10. Right click on the Admin Folder and select Compress.

How to Backup and Restore a Website - Compress Mail Folder

11. In the opened window, select Zip Archive and Enter the name of the compressed archive in the text field, changing it to mail. Click Compress Files.

12. Download the new zip file to the backup-specific folder on your Local Drive.

Part 4: Backup the PUBLIC_HTML Folder

13. Select the public_html Folder. Click Select All, select Compress.

How to Backup and Restore a Website - Mail Folder

14. Select Zip Archive and Enter the name of the compressed archive in the text box and change it to public. Click Compress Files.

How to Backup and Restore a Website - Compress Mail Folder

15. Download the zip file to your Backup folder on the Local Drive

Part 5: WordPress Sites – Copy the Database Name from the WP-CONFIG.PHP File

16. Right click the wp-config.php File under public_html Folder and select Edit.

How to Backup and Restore a Website - Select wp-config.php File

17. Click the Edit button in the pop-up window. 

How to Backup and Restore a Website - Edit wp-config.php File

18. Copy the Database Name and paste it into a Text document (e.g. Notepad, Notepad++) to reference back to later. 

How to Backup and Restore a Website - Copy the Database Name

Part 6: Export the Database

19. Return to the cPanel Dashboard (select the cPanel browser tab) and scroll to Databases and select phpMyAdmin

How to Backup and Restore a Website - Databases - phpPMyAdmin

20. Click the Database Name on the left-hand side. 

How to Backup and Restore a Website - Database

21. Click Export on the top menu bar. 

How to Backup and Restore a Website - Database Export

 22. Leave the default Format as SQL

How to MBackup and Restore a Website - Export Database

  23. Click the Export button.

How to Backup and Restore a Website - Export

24. We suggest that you add the actual backup date to your Backup Folder name and ensure that you backup regularly, or as you require.

How to Restore Backup Files

Part 7: Restoring the .ZIP Files from a Backup Folder

25. After logging in to your cPanel Dashboard, select File Manager in the Files section. 

How to Backup and Restore a Website - cPanel File Manager

26. Click Settings. In the Preferences window tick the Show Hidden Files (dotfiles) checkbox and Save

How to Backup and Restore a Website - Show Hidden Files

27. Select the etc Folder and click the Upload icon. 

How to Backup and Restore a Website - ETC Folder Upload

28. Select the etc .zip Folder Downloaded in Part 2 above. 

How to Backup and Restore a Website - Upload the ETC Zip FIle

29. Click the Go Back arrow. 

How to Backup and Restore a Website - Uploaded etc.zip File

30. You can either right click the zip file and select Extract, or you can select the zip file and click Extract in the top bar. 

How to Backup and Restore a Website - Extract ETC Zipped Files

31. Click the Extract button in the window. Close the Extraction Results dialogue box. 

How to Backup and Restore a Website - Extraction Results

32. Select the mail folder and repeat the above process with the downloaded mail zip file

How to Backup and Restore a Website - Select Mail Folder

33. Next follow the same process for the public_html folder

Part 8: Create a Database if Required

34. Go to your cPanel dashboard browser tab and select Database Wizard under Databases

How to Backup and Restore a Website - cPanel Databases

35. Copy the Database Name that you saved to Notepad in Step 18 above and paste it in the text field. Click Next Step

How to Backup and Restore a Website - cPanel Database Wizard

36. Under Create Database User, enter a Username and Save it to Notepad to access later. 

How to Backup and Restore a Website - Create Database Username and Password

37. Click Password Generator and save the Password to Notepad as well.

How to Backup and Restore a Website - I have copied the password to a safe place

38. Click the checkbox: I have copied the password to a safe place.

39. Click Use Password then click Create User

How to Backup and Restore a Website - All Privileges

40. Tick the ALL PRIVILEGES checkbox and then Make Changes

41. Click Return Home

How to Backup and Restore a Website - Return Home

Part 9: Restoring the Database from the Backup Zip Folder

42. On the cPanel Dashboard, select phpMyAdmin under the Databases section.

How to Backup and Restore a Website - Select Database

43. Select the Database on the left and click Import on the top navigation bar

How to Backup and Restore a Website - Import Database Files

44. Click Choose File – select the Database ZIP File downloaded in Part 6 above. Click Import

How to Backup and Restore a Website - Database Files Imported

Part 10: Editing the WP-CONFIG.PHP File with the Created Database Details

45. Got to your cPanel Dashboard and select File Manager under the Files section. 

46. Click on the public_html Folder in the left menu, right-click on the wp-config.php File and select Edit

How to Backup and Restore a Website - Open the wp-config.php File

47. Click the Edit button. 

How to Backup and Restore a Website - wp-config.php File Edit Window

48. Update the DB_NAME, DB_USER and DB_PASSWORD with the new details that you saved to Notepad.

How to Backup and Restore a Website - Edit the wp-config.php File Database Details

49. Click Save Changes

You have successfully Backed up and restored your website.

How to Backup a Website in cPanel Interface

This article assumes that you have already logged into your Domains.co.za Account and have accessed the cPanel Dashboard – refer below for steps on how to do this.

Backup A Website In cPanel - cPanel Dashboard

Download a Copy of the Backup

1. Under the Files section, go to Backup Wizard

Backup A Website In cPanel - cPanel Dashboard: Files

2. Click the blue Back Up button

Backup A Website In cPanel - Backup Wizard

3. Select Partial Backup, and then click Home Directory

Backup A Website In cPanel - Full Backup

4. Once downloaded, click on Full or Partial Backup at the top

Backup A Website In cPanel - Backups Available for Download

5. Click on the Backup Database shown and wait for it to download

Backup A Website In cPanel - Email Notification

Restore a Backup File in cPanel

6. Under the Files section, go to Backup Wizard

7. Click the Restore button then Home Directory.

Backup A Website In cPanel - Select Restore Type

8. Click on Choose File and select the file from your device, and click on Upload

Backup A Website In cPanel - Backup Wizard Final Step

9. Once the restore has completed, click on Select Restore Type at the top

10. Click on Databases at the bottom left then click on Choose File, select the second file from your device, and click Upload.

11. In the Success message, copy the database name shown in between the double quotes

Restore a Backup in cPanel File Manager

12. At the top right, search for File Manager, and click on this option

Backup A Website In cPanel - Backup Wizard Final Step

13. On the far left, click on public_html then in the file list, right-click the wp-config.php file and choose Edit and Edit again

14. Paste the copied text into the single quotes after DB_NAME and DB_USER, replacing the old database name

15. Copy the password between the single quotes next to DB_PASSWORD then click Save Changes at the top right.

16. In your browser at the very top, navigate to the tab that reads cPanel – Backup Wizard

Create a New User

17. At the top right, search for Manage My Databases, and click on this option

18. Under Database Users > Add New User paste the copied password into both Password fields

19. In the Username field, referencing the database, only enter the part after the first underscore (if the database name is user1_user2_wp123, then ONLY enter user2_wp123)

20. Click the blue Create User button

21. On the new screen, click on Go Back and under Add User To Database make sure the User and Database match those created earlier, and click the blue Add button

22. Choose ALL PRIVILEGES at the top, and click on the blue Make Changes button

Additional Information

Reasons to Backup A Website in cPanel

System Failures & Security Breaches

Backups are essential for recovering lost or damaged files. In the event of a system failure or a security breach, having a website backup ensures you can prevent data loss and restore your site to a previous state where all the data was intact.

Coding Errors & Site Updates

Mistakes happen, and backups are invaluable for getting your website up and running again if issues arise from coding errors. Carelessness during site updates can also cause problems, and having a backup allows for quick recovery.

Plugins, Malware, & Website Testing

Regular backups are critical due to potential compatibility issues with plugins, malware infections, hacker attacks, and the need to create a testing version of your website. Ensuring your site is backed up regularly protects against these risks.

Domains.co.za Daily Backups

Daily website backups are included with all Domains.co.za Web Hosting plans. If you prefer to back up your website manually, you will find the process straightforward and user-friendly.

How to Access cPanel via your Domains.co.za Account

1. Go to the Domains.co.za website Account Login page.

Access WordPress from your Domains.co.za Dashboard - Select Hosting

2. Enter your Email and Password and then click the Sign In button.

How to Backup and Restore a Website  - Manage Services

3. On the right of the Dashboard under the Manage Account menu, click Manage Services on the drop-down menu and select your Hosting plan, our example uses Web Hosting. (refer image above).

Access WordPress from your Domains.co.za Dashboard - Select Hosting

4. Click Manage next to the website domain you wish to access in cPanel.

Access WordPress from your Domains.co.za Dashboard - Manage Hosting

5. The Product Information section will display – click the Login button next to Control PanelcPanel.

How to Backup and Restore a Website - cPanel Dashboard

What Our Customers say...