Skip to main content

Restoring a XAMPP Project from BackupNew Page

IfRestoring a projectXAMPP is accidentally deleted, corrupted, moved to another computer, or you need to continue workingProject from aBackup backup,recreates both the website files and databasethe mustMySQL bedatabase. restored.

This tutorial demonstrates how to restore a complete XAMPP projectWork from a backup.

copy

Backup Requirements

Before restoring, you should have:

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

The project folder contains your website files andof the SQLbackup fileso containsthe youroriginal databaseremains backup.unchanged.


Restore theproject Website Filesfiles

Open

yourInstall backupand folder.test

Example:

XAMPP.
XAMPPStop BackupsApache └──and WebsiteMySQL Filesbefore └──replacing security_dashboardproject 
files.

Copy the entire project folder.

Copy the Files into htdocs

Open:

C:\xampp\htdocs\

Paste thebacked-up project folder into the htdocs.

directory.Confirm

Example:

the
C:\xampp\htdocs\security_dashboardfolder 
contains

Yourthe expected entry page and assets.

Start Apache and open the project shouldthrough nowlocalhost. appear inside

Restore the XAMPPdatabase

web
server folder.

Start XAMPPApache

and MySQL.

Open the XAMPP Control Panel.

Start:

Apache
MySQL

Open phpMyAdmin

Open:

http://localhost/phpmyadmin/

.

You should now see the phpMyAdmin home page.


Create the Databasedatabase

Click:

name
Newexpected 
by

Createthe a databaseproject, using theutf8mb4.

original database name.

Example:

project_db

Click:

Create

Import the Database Backup

Select the newlynew createddatabase database.and

Click:

choose
Import.
Choose the backed-up Import.sql file.

Choose:

Complete
project_db.sqlthe 
import

Click:

and
Import

phpMyAdmin will restore allinspect tables and recordsfictional fromrecords.

If the backupSQL file.export already creates and selects the database, read it before creating another database manually.

Check configuration

Confirm the PDO connection file uses the restored database name and the local XAMPP credentials approved for class. Do not expose credentials in screenshots or public repositories.

Verify the Databaserestoration

SelectTest:

    public entry page registration with a fictional user login and logout role-protected pages database queries and processed outputs administrator CSV import with a small fictional file

    A page loading is not enough; confirm that database changes persist.

    Check

       Files are inside the correct htdocs project folder.  SQL import completes without unresolved errors.  PDO connects to the restored database.

      You

      should see the original tables.

      Example:

      project_db
      ├── users
      └── security_events
      

      Click on a tableAuthentication and verifyrole that records are present.

      Test the Website

      Open your project in a browser.

      Example:

      http://localhost/security_dashboard/

      Check that:

        Pages load correctly. Images display correctly. Login systemschecks work. Database Imported and processed data appearsmatches correctly.expected fictional results.  Original backup remains unchanged.

        Common Problems

        Database Connection Error

        Check:

        Database name
        Username
        Password
        

        inside your PHP connection file.

        Example:

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

        The database name must match the restored database.


        Table Not Found

        Example error:

        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:

          404 Not Found
          

          Solution:

            Verify the project folder is inside:
            C:\xampp\htdocs\
            
              Check the URL is correct.

              Restoration Checklist

              Website Files

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

              Database

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

              Testing

              ✔ Website loads
              ✔ Database connection works
              ✔ Login system works
              ✔ Data displays correctly
              

              Complete Restoration Process

              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.