How to Update XAMPP to a New Version
Updating XAMPP involves backing up your data, uninstalling the old version, installing the new version, and restoring your data. Follow this step-by-step guide carefully to avoid losing any files or databases.
Step 1: Backup Your Existing Data
Before proceeding with the update, it's crucial to back up your files, databases, and configurations.
1.1 Backup Your MySQL Databases
XAMPP uses MySQL/MariaDB for database storage. You must export your databases to avoid losing any data.
Using phpMyAdmin (Recommended)
-
Open your web browser and go to phpMyAdmin (
http://localhost/phpmyadmin/
). -
Click on the Export tab.
-
Choose "Quick – display only the minimal options".
-
Select SQL as the format.
-
Click Go and download the
.sql
file to a safe location.
Using the Command Line (Alternative)
If phpMyAdmin is not accessible, you can use the command line:
-
Open Command Prompt (Windows) or Terminal (Mac/Linux).
-
Navigate to the MySQL
bin
directory: -
Run the following command to export all databases:
(You may need to enter your MySQL password.)
1.2 Backup Your htdocs Folder (Website Files)
The htdocs
folder contains all your website projects, so it's essential to back it up.
-
Navigate to your XAMPP installation folder:
-
Windows:
C:\xampp\htdocs
-
Mac:
/Applications/XAMPP/htdocs
-
-
Copy and paste the
htdocs
folder to another location (e.g., Desktop, external drive).
1.3 Backup Configuration Files (Optional but Recommended)
If you've made changes to XAMPP settings, back up configuration files such as:
-
Apache config:
C:\xampp\apache\conf\httpd.conf
-
PHP config:
C:\xampp\php\php.ini
-
MySQL config:
C:\xampp\mysql\bin\my.ini
Copy these files to a safe location to restore custom settings later.
Step 2: Uninstall the Old XAMPP Version
To prevent conflicts, uninstall the old version before installing the new one.
Windows
-
Open Control Panel → Programs & Features.
-
Find XAMPP, select it, and click Uninstall.
-
Follow the uninstall wizard.
-
Delete any leftover files in
C:\xampp
.
Mac
-
Open Terminal and run:
-
Confirm the deletion when prompted.
Step 3: Download and Install the New XAMPP Version
3.1 Download the Latest XAMPP
-
Visit the official XAMPP website.
-
Download the latest version for your operating system (Windows, Mac, or Linux).
-
Make sure to download the correct PHP version if your project requires a specific one.
3.2 Install XAMPP
-
Run the XAMPP installer (
xampp-windows-x64.exe
on Windows,.dmg
on Mac). -
Choose the components you need (default options are fine).
-
Select the installation directory:
-
Windows:
C:\xampp
-
Mac:
/Applications/XAMPP
-
-
Click Next and complete the installation.
Step 4: Restore Your Data
Now that XAMPP is updated, restore your files and databases.
4.1 Restore the htdocs Folder
-
Copy your backed-up
htdocs
folder. -
Paste it into the new XAMPP installation directory (
C:\xampp\htdocs
or/Applications/XAMPP/htdocs
).
4.2 Restore MySQL Databases
Using phpMyAdmin (Recommended)
-
Open
http://localhost/phpmyadmin/
. -
Click on the Databases tab and create a new database with the same name as your old one.
-
Click Import, then Choose File and select your
.sql
backup file. -
Click Go to restore the database.
Using the Command Line (Alternative)
-
Open the Command Prompt or Terminal.
-
Navigate to the MySQL
bin
directory: -
Run the following command to restore your database:
(Enter the MySQL password when prompted.)
4.3 Restore Configuration Files (If Needed)
If you backed up configuration files (php.ini
, httpd.conf
, my.ini
), compare them with the new files, and apply necessary changes.
-
Open your backed-up config files.
-
Compare them with the new ones in
C:\xampp\php\php.ini
,C:\xampp\apache\conf\httpd.conf
, etc. -
Apply your custom settings manually.
Step 5: Restart XAMPP and Test
5.1 Start XAMPP
-
Open XAMPP Control Panel.
-
Start Apache and MySQL.
-
Check if everything is running properly.
5.2 Test Your Website
-
Open your browser and visit
http://localhost/
to ensure your projects load correctly. -
Open
phpMyAdmin
(http://localhost/phpmyadmin/
) and verify your database is restored.
5.3 Fix Any Issues
-
If Apache or MySQL fails to start, check for port conflicts and update the config files.
-
If your website doesn't work, check for missing dependencies or errors in the PHP version.
Conclusion
You have now successfully updated XAMPP to the latest version! 🎉 Your files, databases, and configurations should be restored, and your projects should work as expected.