How to upgrade Apache and MySql on WAMP server 2.5
Posted by: Mark Murphy (---.fuse.net)
Date: November 26, 2014 10:50PM

The tutorials on how to load a new version of php into wamp server are great, have you done any for adding new apache or mysql versions? I need apache 2.2, and mysql 5.1

Options: ReplyQuote
Re: How to upgrade Apache and MySql on WAMP server 2.5
Posted by: RiggsFolly (---.as43234.net)
Date: November 26, 2014 11:13PM

Hi Mark,

Yup, here you go


HowTo: Install a new version of APACHE into WAMP yourself.


This is not intended to replace the wamp addons mechanism of downloading apache version. If the version you require is available as an addon, use that mechanism, its just so easy.


This tutorial is not really for the absolute beginner. It would help if you had a basic knowledge of how apache/php work together and seperately and their individual configuration, as well as an understanding of what wamp is and does for you.


Read all this document before starting any actual attempt to install an apache version.


This guide assumes you are installing a minor version of an apache you already have installed i.e. apache 2.2.x to apache2.2.y.
I will use the versions 2.2.22 and 2.2.23, the tutorial uses these folder names but of course you will probably be installing different versions.

So here is the process:

1. Download the ZIP version of the Apache you want to run ( not the msi installer, only because I dont know what it may do or assume when it installs )
Suggestion only
[www.apachelounge.com]

2. From wamp manager, Stop all services.

3. Go to c:\wamp\bin\apache\ and create a new folder named appropriately for the release you are installing i.e apache.2.2.23

4. Unzip the Apache downloaded and copy the contents of the unzipped apache folder into your newly created folder in the wamp folder structure. apache2.2.23 in this example.
Make sure the directory levels are the same as your existing apache folder i.e. all the folders get unzipped into a folder called something like apache2, just copy all the subfolders to your new folder wamp\bin\apache\apache.2.2.23 folder. I suggest you unzip it somewhere else and then copy that to the wamp folder.

5. Copy c:\wamp\bin\apache\apache2.2.22\wampserver.conf to c:\wamp\bin\apache\apache2.2.23\wampserver.conf
All the folders in here are relative to where this file lives, so normally nothing need changing in here.
Wamp will not see your new install properly if you forget this step.

6. Now you need to bring your existing httpd.conf file from your current instance of apache.

Be carefull here, things change in the httpd.conf file, parameters get deprecated, new ones get created etc. So use the new httpd.conf as the master and only move over parameters you know you have changed for your actual requirements.

First make a backup of the new wamp\bin\apache\apache2.2.23\httpd.conf as wamp\bin\apache\apache2.2.23\httpd.original.conf ( for example )


Now this new httpd.conf file assumes the location of Apache is the default i.e. c:\apache\....
So there are parameter in YOUR NEW httpd.conf file that MUST BE CHECKED against your old WAMP oriented one
Some but maybe not all are listed here:-

Listen
ServerRoot
ServerAdmin
ServerName
DocumentRoot
<Directory....> Check all the directory parameters match the wamp file structure
ErrorLog
CustomLog
LoadModule
AddType
MimeType
DirectoryIndex Add index.php to this list


Now we must configure apache to use the correct version of PHP.
'LoadModule'
Wamp default is to runs PHP as an apache handler, that means apache loads the PHP interpreter as an apache module. ( see below )
Remember the Apache conf does not assume you are a PHP user so you will have to add this to the new conf file rather than change it.
So you must also check you are loading the correct handler for the version of apache and PHP you want to use.
The PHP folder should contain 1 or more of these handlers ( dll's ) depending on which versions of php it has been compiled for ( not all php version will run with all apache's ).
You must load the correct dll to match the apache version and the php version you want to use.


Ok I am afraid we need a bit of Techy Stuff here.
When PHP is compiled, by cleverer people than us! It is actually compiled more than once for various situations.
If you look in the php/phpx.y.z folder you will see a php.exe, php-win.exe, php-cgi.exe, all of which are irrelivant in the context of this document.

You will also see one or more dll files with names like php5apache2.dll, php5apache2_2.dll, php5apache2_4.dll, again depending on which apache you have download.
These are the php interpreter compiled into a dll for use as an apache handler.
The version of apache that this php is comiled to run with, is denoted by the apache2 (apache 2.0 or 2.1) or apache2_2 (apache 2.2 or 2.3) or apache2_4 ( apache 2.4 ) part of the filename.
The php5 part denotes it is a version of php5 ( but does not tell you which version of php5 ).
The version of php is denoted by the fact that you downloaded php5.3.13 and have luckily loaded it into a folder called php5.3.13 so you know whats what.


If you are using PHP 5.4 with an apache 2.4.x instance:
LoadModule php5_module "d:/wamp/bin/php/php5.4.x/php5apache2_4.dll" for using PHP 5.4

If you are using PHP 5.2 or PHP 5.3 with an apache 2.2.x instance:
LoadModule php5_module "d:/wamp/bin/php/php5.2.x/php5apache2_2.dll"

If you want to use PHP with an apache 2.0.x or 2.1.x instance:
LoadModule php5_module "d:/wamp/bin/php/php5.1.x/php5apache2.dll" for using PHP

NOTE:
This parameter is in the httpd.conf but is loading a file from a PHP folder.

If the php version folder does not contain a handler that matches apache version you want to run then that version of php wont run with that version of apache or your php download has not been compiled for that version of apache, normally the former.

Armed with this information you should be able to find the correct handler for the version of apache and php that you want to run together.


7. If you are using Virtual Servers you will also need to copy the conf\extras\httpd-vhosts.conf file from your old Apache version folder to your new folder.

8. We should be nearly done, so
Right click wampmanager -> refresh

This will tell wamp manager to re-configure itself and go look for anything new in its folder structure i.e. your new apache.
Check it has worked by: left click wampmanager -> Apache -> Versions, you should see your new one appear in the list.

8. Now Left click wamp manager -> Apache -> Versions -> and click your new version numbers to activate the new version of Apache.
This will restart apache and run your new version.

If apache fails to start ( wamp manager stays orange ) either you or I have missed a step. I hope its you!


TROUBLE SHOOTING
If you make a mistake check the apache error log for clues, or the windows event viewer, apache writes errors to this as well as its error log.

If all else fails, delete the new apache.x.y.z folder and re run the Right click on wamp manager -> Refresh and it will re configure itself without your new apache and you can start again.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: How to upgrade Apache and MySql on WAMP server 2.5
Posted by: RiggsFolly (---.as43234.net)
Date: November 26, 2014 11:13PM

HowTo: Install a new version of MySQL into wamp and migrate your data properly.


Please read the whole post before starting this process. Mistakes can cause untold hassle.

Also take a copy of your WHOLE C:\WAMP folder so you can replace it if necessary if something goes wrong.

A backup of your databases is also a good idea.


Assumption: That you are using the default wamp config where all your databases are stored in the mysql.x.y.x\data\ folder.
If thats the case no backup of your databases is necessary, but it would not hurt, just in case.
This should also work if you are using innodb databases, stored in the mysql.x.y.x\data\ folder.


This will take your complete MySQL environment, including users, passwords and privilages so they do not need to be re-created on the new release.


I have tried to keep it simple here using c:\wamp, but you may have wamp on another drive, just change c: to whatever you use.

Before you start read the upgrade notes on the mysql.com site for information on anything you may have to do to your existing data before you start the upgrade.
There should be a page devoted to major upgrades, you will have to read between the lines if you are doing a minor upgrade.

A glance at the changelog is also a good idea as it will give you a clue as to what has changed and how that may effect your SQL and or data.


So here is the process:

1. Download the ZIP version of the mysql you want to run ( not the msi installer, only because I dont know what it may do or assume when it installs )
Suggested source [www.mysql.com]

2. From wamp manager, Stop all services.

3. Go to c:\wamp\bin\mysql\ and create a new folder named appropriately i.e mysql5.5.28

4. Unzip the mysql and copy the contents of the MySQL folder into your newly created folder. Make sure the directory levels are the same as your existing MySQL folder.

5. Copy all the contents of your previous mysql\mysql5.5.10\data folder into the new data folder under your newly created version folder.
Thats EVERYTHING not just your databases, including the ibdata1, ib_logfile0, ib_logfile1 and all the mysql-bin.0000xx files.
We are going to use the recommended mysql-upgrade tool so this is ok to do.
This will also ensure that you keep all your Users and password and granted privilages intact when the upgrade is complete.

6. Copy c:\wamp\bin\mysql\mysql5.5.10\wampserver.conf to c:\wamp\bin\mysql\mysql5.5.28\wampserver.conf
All the folders in here are relative to where this file lives, so normally nothing need changing in here.

7. RIGHT CLICK wampmanager -> refresh
This will make wamp manager find your new version.
Check this by Left click wampmanager -> MySQL -> Versions Your new version should be available in the list.

8. From wamp manager -> MySQL -> Version click on your new version.
Normally you would have to uninstall the old wampmysql service and re-install the new wampmysql service, but wamp takes care of all that for you by just clicking the new version number.
This should also start the new mysql service, so now the new mysql is running.
BUT DONT DO ANYTHING YET!!!

9. Launch a command window ( using Run As Administrator ).
CD into c:\wamp\bin\mysql\mysql5.5.28\bin folder ( the new releases bin folder ).
And run
mysql_upgrade -u[your MySQL admin userid] -p > upgrade_results.txt

It will ask you for the password for the admin user you provided on the -u parameter.
enter the password.

Wait while it runs, If you have very large databases this may take some time but normally it will take anything from a few seconds to a minute or two.
This will look at your databases and do any upgrades that are required and also any upgrades/maintenace of the mysql database that MySQL uses internally.
Thats the tables that contain your userids and password and privilages and other things.

10. Check for errors in the upgrade_results.txt file, fix if there are any.
You can repeat this as often as you like, just refresh the data from the old versions data folder each time.

11. LEFT Click wamp manager -> MySQL -> Service -> Stop Service.
Then again and Start Service. This will load the changed mysql database with any new/changed config info.

12. At this point assuming you are staying on the newly installed version of MySQL its a good idea to run:
wampmanager -> MySQL -> MySQL Console
and run a
> reset master;

To reset the log files.



Thats it your are ready to go and all your userid's and data are converted to the new MySQL version.

TROUBLESHOOTING

The Beauty of WAMP
If you find you have a problem with one of your databases you can just switch the MySQL Version back to the old version, fix the databases using MySQL Workbench or phpMyAdmin.
The copy all the contents of the data folder into your new release and re-run the mysql_upgrade.exe as many times as it takes to fix your issues.

And of course if it all goes bad in a big way, you can switch the MySQL version back to whatever you were using before and all your data is still there UNTOUCHED.


Now this may seem obvious but I am going so say it anyway:
1. If everything goes smoothly you do have to remember that you now have 2 versions of the same database(s) that are being maintained SEPERATELY.
2. It is not possible to use this process to DOWNGRADE your databases!!!

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.