# Moving a XAMPP Project to Another Computer

One of the advantages of using XAMPP is that projects can easily be moved between computers.

This is useful when:

- Working between school and home.
- Upgrading to a new computer.
- Sharing a project with a teacher.
- Creating a backup before reinstalling Windows.

A complete project transfer requires:

1. Website files.
2. Database files.

---

## On the Original Computer

Before moving the project, create a backup.

You should have:

```text
XAMPP Backups
├── Website Files
│   └── security_dashboard
│
└── Databases
    └── project_db.sql
```

If you have not already created a backup, refer to:

```text
Backing Up a XAMPP Project
```

---

## Copy the Backup Files

Copy the backup folder to:

- USB drive
- External hard drive
- OneDrive
- Google Drive

Example:

```text
USB Drive
└── XAMPP Backups
```

[![image-1781051544998.png](https://mr.napper.au/uploads/images/gallery/2026-06/scaled-1680-/image-1781051544998.png)](https://mr.napper.au/uploads/images/gallery/2026-06/image-1781051544998.png)

## Install XAMPP on the New Computer

Download XAMPP:

https://www.apachefriends.org/

Install XAMPP using the default settings.

The installation folder will usually be:

```text
C:\xampp\
```



## Start XAMPP

Open the XAMPP Control Panel.

Start:

```text
Apache
MySQL
```

Both services should show a green status.

[![image-1781051802720.png](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)

## Copy the Website Files

Open:

```text
C:\xampp\htdocs\
```

Copy the project folder from your backup.

Example:

```text
security_dashboard
```

Paste it into:

```text
C:\xampp\htdocs\
```

Your folder structure should now look like:

```text
C:\xampp\htdocs\
└── security_dashboard
```



## Create the Database

Open phpMyAdmin:

[http://localhost/phpmyadmin/](http://localhost/phpmyadmin/)

Click:

```text
New
```

Create a database with the same name as the original project.

Example:

```text
project_db
```

Click:

```text
Create
```



## Import the Database Backup

Select:

```text
project_db
```

Click:

```text
Import
```

Choose:

```text
project_db.sql
```

Click:

```text
Import
```

Wait for the import to complete.

[![image-1781051867640.png](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 Tables

After importing, you should see the project tables.

Example:

```text
project_db
├── users
├── security_events
└── products
```

Your tables may differ depending on the project.


## Check the Database Connection

Open the database connection file used by the project.

Example:

```php
$conn = new mysqli(
    "localhost",
    "root",
    "",
    "project_db"
);
```

Verify:

- Database name is correct.
- Username is correct.
- Password is correct.

The default XAMPP configuration uses:

```text
Server: localhost
Username: root
Password: (blank)
```

---

## Test the Website

Open:

```text
http://localhost/security_dashboard/
```

Check:

- Pages load correctly.
- Images display correctly.
- Database content appears.
- Login systems work.
- Forms submit correctly.



## Common Problems

### Database Not Found

Example:

```text
Unknown database 'project_db'
```

Solution:

- Create the database.
- Import the SQL backup.

---

### Table Not Found

Example:

```text
Table 'project_db.users' doesn't exist
```

Solution:

- Verify the SQL file imported successfully.
- Check the table exists in phpMyAdmin.

---

### Access Denied

Example:

```text
Access denied for user 'root'
```

Solution:

- Check the database username and password.
- Verify MySQL is running.

---

### Page Not Found

Example:

```text
404 Not Found
```

Solution:

- Confirm the project folder is inside:

```text
C:\xampp\htdocs\
```

- Verify the URL matches the folder name.

---

## Transfer Checklist

### Website Files

```text
✔ Project folder copied
✔ Files restored to htdocs
✔ Images restored
✔ CSS restored
✔ JavaScript restored
✔ PHP files restored
```

### Database

```text
✔ Database created
✔ SQL file imported
✔ Tables restored
✔ Data restored
```

### Testing

```text
✔ Website loads
✔ Database connection works
✔ Forms work
✔ Login works
✔ Data displays correctly
```

---

## Complete Process

```text
Original Computer
        ↓
Create Backup
        ↓
Copy to USB / Cloud Storage
        ↓
Install XAMPP
        ↓
Copy Website Files
        ↓
Create Database
        ↓
Import SQL File
        ↓
Test Website
```

You have successfully moved a XAMPP project to another computer.