You are here:Home»KB»Web Server»xampp»Upgrade Xampp and keep your data
Thursday, 07 July 2022 07:29

Upgrade Xampp and keep your data

Written by

Xampp does not have an inbuilt upgrade mechanism and there does not appear to be any official instructions on how to upgrade your Xampp install in full or just certain aspects such as PHP.

My xampp location is always at:

D:\xampp
  • I put it on the D: drive because the amount of files that are created and this made it easier to defrag and keeps it away from my neat C: drive.

Full Upgrade

These instructions will show you how to upgrade your Xampp installation in full and assumes you have used the portable version. I never use the installer.

  • Backup the whole xampp folder
  • Export the Databases - using one of the options below:
    These processes will wipe any date in the target databases
    1. Copy and Paste
      • This requires xampp to be shutdown cleanly.
      • This will not work if the source is MySQL and the target is MariaDB etc... and perhaps if the version of the DB are too different.
      • Nothing needs to be done at this point
    2. Command Line
      • Dump all databases with the command line.
      • This does not suffer from timeouts
      • Run one of these commands:
        From the xampp shell:
        mysqldump -u root -p --all-databases > all-db-dump.sql
        
        From the command line:
        D:\xampp\mysql\bin\mysqldump -u root -p --all-databases > all-db-dump.sql
        
        NB: These can be used for doing a backup of you databases
        
    3. phpMyAdmin
  • Uninstall xampp as a service (if enabled)
  • Shutdown xampp
  • Rename the xampp folder
    From: D:\xampp\htdocs
    
    To: D:\old-xampp\htdocs
  • Download the new portable/zip/7z version of xampp
  • Inside the D:\xampp\htdocs folder there are some xampp only files, just delete them or move them into their own folder just in-case you need them later (they are always in the downloaded file)
  • Run the setup batch file
    D:\websites\setup_xampp.bat
  • Import the databases - use the method you did to export them
    1. Copy and Paste (this works)
      • Make sure that xampp is not running
      • Delete the new database files
        D:\xampp\mysql\data
      • Copy the old database files
        From: D:\old-xampp\mysql\data
        
        To: D:\xampp\mysql\data
      • Start the Xampp control panel
      • Start Apache and MySQL
      • Run the 'Xampp Shell' (by clicking the button in the control panel)
      • Run the command and wait. It might not be quick.
        mysql_upgrade
    2. Command Line
      • Import all databases with the command line.
      • This does not suffer from timeouts
      • Run one of these commands:
        From the xampp shell:
        mysql -u root -p < all-db-dump.sql
        
        From the command line:
        D:\xampp\mysql\bin\mysql -u root -p < D:\all-db-dump.sql
        
        NB: These can be used for restoring a backup of you databases
        
    3. phpMyAdmin
  • Copy/move all of your website files from the old location to your new xampp folder
    From: D:\old-xampp\htdocs
    
    To: D:\xampp\htdocs 
  • Copy my libraries folder and update the libraries (this is only for me)
    From D:\xampp\libraries
    
    To: D:\xampp\libraries
  • Exit Xampp and make sure it is not running
  • Compare/merge your config files (as required)
    D:\xampp\php\php.ini
    D:\xampp\mysql\bin\my.ini
    D:\xampp\phpMyAdmin\config.inc.php
    D:\xampp\apache\conf\httpd.conf
    D:\xampp\apache\conf\extra\httpd-ssl.conf
    D:\xampp\apache\conf\extra\httpd-xampp.conf
    D:\xampp\apache\conf\extrahttpd-vhosts.conf
    D:\xampp\xampp-control.ini
  • Additional PHP extensions - Updated versions will probably be required, they are located here:
    D:\xampp\php\ext
    • Ioncube
      • Thread Safe and 64 Bit
      • Loader Download | ionCube - Secure and license your PHP scripts with the ionCube PHP Encoder 11.0. Secure valuable code with bytecode compilation, encryption and licensing capabilities.
    • Xdebug: Downloads - Xdebug: A powerful debugger for PHP
      • Xampp 7.4 (64 bit)
        • Xdebug v2.8.1 Thread Safe 64 Bit
        • eg: php_xdebug-2.8.1-7.4-vc15-x86_64.dll
        • The file has been renamed.
      • There is a new 3.x series of xdebug that uses slightly different code in the php.ini but this can be found in the xdebug section of netbeans
        • An example file name for the required version in this series is: php_xdebug-3.1.5-7.4-vc15-x86_64.dll
      • I have not used v3.x yet but I am sure it will work fine with the right calling code.
      • Naming Explained
        • x86_64 = 64 Bit
        • nts = Non thread Safe
        • lack of nts = Thread Safe
        • TS (on download button) =  Thread safe
  • Set Notepad++ as the default text editor
    C:\Program Files\Notepad++\notepad++.exe
  • Enable Autostart of the Apache and MySQL modules
  • Set my folder icons so i can see things easily
    D:\xampp
    D:\xampp\htdocs
    D:\xampp\libraries
  • Put a text file called version.txt in the xampp root folder showing the version installed. This can be useful if things go wrong.
  • If you have anything else like SSL certs installed you will need to figure that out yourself.
  • Final Things
    • make sure PHPMyadmin default collation has been set to your preferred option (mine is utf8mb4_unicode_ci)
    • Apply the phpMyAdmin pmahomme template fix
  • Restart Xampp

Keep your old xampp files for awhile to make sure you have not missed anything

Links

Read 682 times Last modified on Thursday, 07 July 2022 15:32