Skip to main content

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:

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

If you have not already created a backup, refer to:

Backing Up a XAMPP Project

Copy the Backup Files

Copy the backup folder to:

  • USB drive
  • External hard drive
  • OneDrive
  • Google Drive

Example:

USB Drive
└── XAMPP Backups

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:

C:\xampp\

Start XAMPP

Open the XAMPP Control Panel.

Start:

Apache
MySQL

Both services should show a green status.

image-1781051802720.png

Copy the Website Files

Open:

C:\xampp\htdocs\

Copy the project folder from your backup.

Example:

security_dashboard

Paste it into:

C:\xampp\htdocs\

Your folder structure should now look like:

C:\xampp\htdocs\
└── security_dashboard

Create the Database

Open phpMyAdmin:

http://localhost/phpmyadmin/

Click:

New

Create a database with the same name as the original project.

Example:

project_db

Click:

Create

Import the Database Backup

Select:

project_db

Click:

Import

Choose:

project_db.sql

Click:

Import

Wait for the import to complete.

image-1781051867640.png

Verify the Tables

After importing, you should see the project tables.

Example:

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:

$conn = new mysqli(
    "localhost",
    "root",
    "",
    "project_db"
);

Verify:

  • Database name is correct.
  • Username is correct.
  • Password is correct.

The default XAMPP configuration uses:

Server: localhost
Username: root
Password: (blank)

Test the Website

Open:

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:

Unknown database 'project_db'

Solution:

  • Create the database.
  • Import the SQL backup.

Table Not Found

Example:

Table 'project_db.users' doesn't exist

Solution:

  • Verify the SQL file imported successfully.
  • Check the table exists in phpMyAdmin.

Access Denied

Example:

Access denied for user 'root'

Solution:

  • Check the database username and password.
  • Verify MySQL is running.

Page Not Found

Example:

404 Not Found

Solution:

  • Confirm the project folder is inside:
C:\xampp\htdocs\
  • Verify the URL matches the folder name.

Transfer Checklist

Website Files

✔ Project folder copied
✔ Files restored to htdocs
✔ Images restored
✔ CSS restored
✔ JavaScript restored
✔ PHP files restored

Database

✔ Database created
✔ SQL file imported
✔ Tables restored
✔ Data restored

Testing

✔ Website loads
✔ Database connection works
✔ Forms work
✔ Login works
✔ Data displays correctly

Complete Process

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.