Its about time I update my local development environment and clean up all the clutter.
Hetzner (my preferred data center) is also rolling out PHP version 7.2 so this forces me to start developing and testing current applications on the same environment.

There are 2 problems to keep in mind when planning these updates:

  • Backing up MYSQL databases! Once you delete or uninstall a current XAMP installation, you will lose all  your data.  The only option is to export each database and while this is doable, it is a tedious and time consuming task.
  • Backing up website files. This is easily achieved with a simple copy and paste or better yet, just rename the entire Xamp directory to something like xamp-backup. This way, all the files and folders remain untouched

The biggest concern with updating XAMP or WAMP is losing data especially databases.


Back up first

  1. Fire up Xamp by right clicking on the shortcut and run as adminstrator, (right click on the icon and click run an administrator).
  2. Click on the shell button, it should open up a terminal.
  3. Enter the following command mysqldump -u root -p --all-databases > all-db-dump.sql ‘root’ is the username and p is the password. The password is usually blank unless youve configured it differently.
  4. Run the command by pushing enter, it may ask for a password, if it does enter the password and hit enter.
  5. Once the command has run, give it a moment and check your xamp folder for an SQL file called all-db-dump.sql
  6. To back up the website files, either copy and past the entire htdocs folder or simply rename the xamp foldler to xamp-backup

Following the above instructions will leave you with a back up of all the databases and website files.

You can now uninstall XAMP, download the latest version and install.

Download XAMP here

Once your fresh installation of XAMP is completed, you need to restore your content.

  1. Copy the content from the previous htdocs folder to the fresh installations htdocs folder.
  2. Restore the databases by following the instructions below:

Restoring multiple databases

  1. Open up the command line.
  2. Cd into the mysql folder at C:\xampp\mysql\bin
  3. Run the following commandmysql -u root -p < path-to-file/all-db-dump.sql
  4. Let it run for a while, it may take a few minutes depending on the size of your database backup

I hope this quick reference serves as a guide for others.


Need a website, consultation or customisation? Let’s speak