# Restoring a XAMPP Project from BackupNew Page

If a project is accidentally deleted, corrupted, moved to another computer, or you need to continue working from a backup, both the website files and database must be restored.

This tutorial demonstrates how to restore a complete XAMPP project from a backup.

---

## Backup Requirements

Before restoring, you should have:

```text
XAMPP Backups
├── Website Files
│   └── security_dashboard
│
└── Databases
    └── project_db.sql
```

The project folder contains your website files and the SQL file contains your database backup.

---

## Restore the Website Files

Open your backup folder.

Example:

```text
XAMPP Backups
└── Website Files
    └── security_dashboard
```

Copy the entire project folder.

---

## Copy the Files into htdocs

Open:

```text
C:\xampp\htdocs\
```

Paste the project folder into the `htdocs` directory.

Example:

```text
C:\xampp\htdocs\security_dashboard
```

Your project should now appear inside the XAMPP web server folder.


## Start XAMPP

Open the XAMPP Control Panel.

Start:

```text
Apache
MySQL
```

[![](https://mr.napper.au/uploads/images/gallery/2026-06/scaled-1680-/image-1781051802720.png)](https://mr.napper.au/uploads/images/gallery/2026-06/image-1781051802720.png)

## Open phpMyAdmin

Open:

[http://localhost/phpmyadmin/](http://localhost/phpmyadmin/)

You should now see the phpMyAdmin home page.

---

## Create the Database

Click:

```text
New
```

Create a database using the original database name.

Example:

```text
project_db
```

Click:

```text
Create
```


## Import the Database Backup

Select the newly created database.

Click:

```text
Import
```

Choose:

```text
project_db.sql
```

Click:

```text
Import
```

phpMyAdmin will restore all tables and records from the backup file.

[![](https://mr.napper.au/uploads/images/gallery/2026-06/scaled-1680-/image-1781051867640.png)](https://mr.napper.au/uploads/images/gallery/2026-06/image-1781051867640.png)

## Verify the Database

Select the restored database.

You should see the original tables.

Example:

```text
project_db
├── users
└── security_events
```

Click on a table and verify that records are present.



## Test the Website

Open your project in a browser.

Example:

[http://localhost/security_dashboard/](http://localhost/security_dashboard/)

Check that:

- Pages load correctly.
- Images display correctly.
- Login systems work.
- Database data appears correctly.


## Common Problems

### Database Connection Error

Check:

```text
Database name
Username
Password
```

inside your PHP connection file.

Example:

```php
$conn = new mysqli(
    "localhost",
    "root",
    "",
    "project_db"
);
```

The database name must match the restored database.

---

### Table Not Found

Example error:

```text
Table 'project_db.users' doesn't exist
```

Solution:

- Confirm the SQL file imported successfully.
- Verify the table exists in phpMyAdmin.
- Re-import the database if required.

---

### Page Not Found

Example:

```text
404 Not Found
```

Solution:

- Verify the project folder is inside:

```text
C:\xampp\htdocs\
```

- Check the URL is correct.

---

## Restoration Checklist

### Website Files

```text
✔ Project folder copied to htdocs
✔ Images restored
✔ CSS restored
✔ JavaScript restored
✔ PHP files restored
```

### Database

```text
✔ Database created
✔ SQL file imported
✔ Tables restored
✔ Records restored
```

### Testing

```text
✔ Website loads
✔ Database connection works
✔ Login system works
✔ Data displays correctly
```

---

## Complete Restoration Process

```text
Backup Folder
        ↓
Copy Project Files
        ↓
Paste into htdocs
        ↓
Create Database
        ↓
Import SQL File
        ↓
Test Website
```

You have successfully restored a XAMPP project from a backup.

Next tutorial: **Moving a XAMPP Project to Another Computer**.