How to Update XAMPP to a New Version

How to Update XAMPP to a New Version


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)

  1. Open your web browser and go to phpMyAdmin (http://localhost/phpmyadmin/).

  2. Click on the Export tab.

  3. Choose "Quick – display only the minimal options".

  4. Select SQL as the format.

  5. 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:

  1. Open Command Prompt (Windows) or Terminal (Mac/Linux).

  2. Navigate to the MySQL bin directory:

    cd C:\xampp\mysql\bin (Windows) cd /Applications/XAMPP/xamppfiles/bin (Mac)
  3. Run the following command to export all databases:

    mysqldump -u root -p --all-databases > backup.sql

    (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.

  1. Navigate to your XAMPP installation folder:

    • Windows: C:\xampp\htdocs

    • Mac: /Applications/XAMPP/htdocs

  2. 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

  1. Open Control PanelPrograms & Features.

  2. Find XAMPP, select it, and click Uninstall.

  3. Follow the uninstall wizard.

  4. Delete any leftover files in C:\xampp.

Mac

  1. Open Terminal and run:

    sudo rm -rf /Applications/XAMPP
  2. Confirm the deletion when prompted.

Step 3: Download and Install the New XAMPP Version

3.1 Download the Latest XAMPP

  1. Visit the official XAMPP website.

  2. Download the latest version for your operating system (Windows, Mac, or Linux).

  3. Make sure to download the correct PHP version if your project requires a specific one.

3.2 Install XAMPP

  1. Run the XAMPP installer (xampp-windows-x64.exe on Windows, .dmg on Mac).

  2. Choose the components you need (default options are fine).

  3. Select the installation directory:

    • Windows: C:\xampp

    • Mac: /Applications/XAMPP

  4. 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

  1. Copy your backed-up htdocs folder.

  2. Paste it into the new XAMPP installation directory (C:\xampp\htdocs or /Applications/XAMPP/htdocs).

4.2 Restore MySQL Databases

Using phpMyAdmin (Recommended)

  1. Open http://localhost/phpmyadmin/.

  2. Click on the Databases tab and create a new database with the same name as your old one.

  3. Click Import, then Choose File and select your .sql backup file.

  4. Click Go to restore the database.

Using the Command Line (Alternative)

  1. Open the Command Prompt or Terminal.

  2. Navigate to the MySQL bin directory:

    cd C:\xampp\mysql\bin (Windows) cd /Applications/XAMPP/xamppfiles/bin (Mac)
  3. Run the following command to restore your database:

    mysql -u root -p < backup.sql

    (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.

  1. Open your backed-up config files.

  2. Compare them with the new ones in C:\xampp\php\php.ini, C:\xampp\apache\conf\httpd.conf, etc.

  3. Apply your custom settings manually.

Step 5: Restart XAMPP and Test

5.1 Start XAMPP

  1. Open XAMPP Control Panel.

  2. Start Apache and MySQL.

  3. Check if everything is running properly.

5.2 Test Your Website

  1. Open your browser and visit http://localhost/ to ensure your projects load correctly.

  2. 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.

Soeng Souy

Soeng Souy

Website that learns and reads, PHP, Framework Laravel, How to and download Admin template sample source code free.

Post a Comment

CAN FEEDBACK
close