Skip to main content

Backing Up a XAMPP Project

A XAMPP project usually consists of two parts:

  1. The website files stored in the htdocs folder.
  2. The MySQL database storing the application's data.

To create a complete backup, both parts must be saved.


Create a Backup Folder

Create a folder somewhere safe, such as:

OneDrive - Department of Education
└── XAMPP Backups

Inside it create:

XAMPP Backups
├── Website Files
└── Databases

Back Up the Website Files

Open the XAMPP installation folder.

Example:

C:\xampp\htdocs\

Locate your project folder.

Example:

C:\xampp\htdocs\security_dashboard

Copy the entire project folder into:

XAMPP Backups
└── Website Files

Your backup should now contain:

Website Files
└── security_dashboard

This backup includes:

  • HTML files
  • PHP files
  • CSS files
  • JavaScript files
  • Images
  • JSON files

Open phpMyAdmin

Open phpMyAdmin in your browser.

Example:

http://localhost/phpmyadmin/

Select the database used by your project.

Example:

project_db

Export the Database

Click:

Export

Choose:

Method: Quick
Format: SQL

Click:

Export

A file similar to the following will be downloaded:

project_db.sql

Save the Database Backup

Move the downloaded SQL file into:

XAMPP Backups
└── Databases

Your backup folder should now contain:

XAMPP Backups
├── Website Files
│   └── security_dashboard
│
└── Databases
    └── project_db.sql

Test the Backup

Before making major changes to a project, check that:

  • Website files have been copied successfully.
  • The SQL file exists.
  • The SQL file is not empty.

A backup is only useful if it can be restored.


Complete Backup Checklist

Website Files

✔ Project folder copied
✔ Images copied
✔ CSS copied
✔ JavaScript copied
✔ PHP files copied

Database

✔ Database selected
✔ Export completed
✔ SQL file saved

Backup Structure Example

XAMPP Backups
├── Website Files
│   └── security_dashboard
│       ├── index.php
│       ├── dashboard.php
│       ├── css
│       ├── js
│       └── images
│
└── Databases
    └── project_db.sql

You now have a complete backup of your XAMPP project.

Next tutorial: Restoring a XAMPP Project from Backup.