XAMPP Upgrade Tasks

I usually have 3 simple and separate tasks for a XAMPP upgrade or any general development environment migration (for example when moving to a new Windows or Mac hardware).

  1. Moving the source codes, files and assets: copy the www folder with all the project source codes local virtual host domains
  2. Apache configuration: edit the httpd.conf and httpd-vhosts.conf files
  3. MySQL migration: migrate the database

Source files

Usually I have a separate www folder configured with vhosts.

Apache Configuration

I only change the following line in httpd.conf because I like to develop on port 8080.

Listen 8080

And as a habit (Debian and FreeBSD) check if the vhosts file is included:

Include conf/extra/httpd-vhosts.conf

The httpd-vhosts.conf file has multiple entries (for each project or local domain name):

<VirtualHost *:8080>
    ServerName client1.san
    ServerAlias www.client1.san
    DocumentRoot C:/xampp/www/client1
</VirtualHost>

MySQL Migration

A fresh copy of a pristine MySQL installation with PHPMyAdmin has the following databases:

  • information_schema
  • mysql
  • performance_schema
  • phpmyadmin
  • test

So when migrating I try to avoid copying over those five databases / schema.

Preview(opens in a new tab)

While it might be OK to dump the database via PHPMyAdmin, it’s not a good idea to restore it via a web interface. For example my combined database size is almost 1 GB.

So ensure you have a decent max_allowed_packet size in specified in my.ini:

max_allowed_packet=16M

Then run the database restore command manually from the command line. For example:

mysql -u root < databases_to_migrate.sql

MySQL Workbench 8.0 – Set the Default Time Zone

MySQL Workbench 8.0.19
MySQL Server 8.0.19

Summary

Here is a single screenshot summary of the actions you need to take in 6 labelled steps to change the time zone via MySQL workbench:

Detailed Steps

A detailed list of steps follow below.

Step 1 & 2

Either click from the main navigation menu -> Server -> Options File:

Or from the left navigation Administration tab -> Options File:

Step 3, 4 & 5

Then under General tab scroll down to the International field set, then locate the default-time-zone field, set it to your preferred zone:

Step 6

Then click on the Apply button:

You will get a confirmation box, hit the Apply button.

Directly Edit Config File my.ini

An alternative would be to directly edit the my.ini file and set the property:

default_time_zone = +8:00

In Windows 10, you can find the file here:

C:\ProgramData\MySQL\MySQL Server 8.0\my.ini