how to update 2.2 to 2.4?
Posted by: SlouchingDog (94.228.205.---)
Date: August 28, 2013 07:52PM

Good day, how should i update wampserver 2.2 to 2.4?
can i do it without loosing data?

Options: ReplyQuote
Re: how to update 2.2 to 2.4?
Posted by: RiggsFolly (---.as13285.net)
Date: August 29, 2013 10:49AM

Before installing the new release.

This is not a simple click and go process. There are many things that can trip you up. However it is quite achievable with a bit of common sense!
Dont start this process if you only have 20 minutes to get it done, that should be all you need, but depending on your skill level and the number of releases of all 3 pieces of software you are skipping it may take longer.


First Backup all your databases, thats your databases and not the ones that come with MySQL. Save the backups somewhere safe and readily available.

MySQL's databases are 'mysql', 'information_schema' and 'performance_schema' dont back these up, unless you know what you are doing and you know you need them.
Also you dont need the database called 'test' unless you used it for something you want to keep.

If your databases are small to medium sized you can use can use phpMyAdmin to do the backups.
If they are large and phpMyAdmin fails to back them up ( normally due to a PHP max_runtime limit ) you will have to backup using the mysqldump.exe. see [dev.mysql.com] for help on that.

Now if all your sites connect to their databases using 'localhost','root' and '' ( a blank password) there is nothing else to do. ( NOT A GOOD IDEA BY THE WAY )
if you set a root password and use ('localhost','root' and 'some_password_you_set' ) you just need to remember that password so you can recreate it on the new version of MySQL. ( ALSO NOT A GOOD IDEA )
However if you have done things properly and created specific MySQL users and passwords for each of your site(s) databases you are going to have to go and find out what these userids and passwords are and make a note so you can recreate them after you have restored your databses on the new version of MySQL.
It is possible to query MySQL and generate script to automatically dump and restore these, but you are going to have to go and read that up on the MySQL site if you want to do that.


So now before we install the new WAMP Server

Start wampmanager, and remove the MySQL and Apache services.
wampmanager -> MySQL -> Service -> Remove service
wampmanager -> Apache -> Service -> Remove service

Now stop wampmanager.
rightclick wampmanager -> Exit

Rename your wamp folder to something eg 'wamp_old'

Now you can install the new version of WAMP Server, so lets do that.
Download and install the new WAMP, you can install onto any drive C;, D; E; etc, install it into the root of the drive i.e. C:\wamp, but dont install into C:\Program Files\

Check your new install works by:
Starting WAMP if you didnt start it automatically out of the install.
1. Check the wampmanager icon in the system tray goes GREEN.
2. Run : wampmanager -> localhost
3. Click on the phpMyAdmin link on this page, and check this works also.
WampServer 2.4 comes with a different phpmyadmin configuration, so it will initially load to a login page. Remember on a new install the username = root and the password is BLANK.

If you get problem with either, remember this new install does not have any of the config tailoring that you may have done to the previous release. So now would be the time to compare you old config's with the new ones and bring over anything from the old config that you need again on the new install.
Also remember you are upgrading Apache, MySQL and PHP. and parameters for all 3 of these may have changed / been added to/ or have been removed!!!!
So dont just copy them over from your old wamp to the new. THERE BE DRAGONS !!!
This is also why we dont delete the old wamp folder, until we are sure the new install is working properly.

Specifically check these files, but depending on what you have done to Apache/PHP/MySQL there may be others, only you can know this.
Make changes to these files bit by bit checking that Apache and MySQL dont report and errors between each change
https.conf,
\wamp\alias\phpmyadmin.conf,
\wamp\alias\sqlbuddy.conf,
\wamp\alias\webgrind.conf,

If you are using Apache 2.2.? make sure the Apache security looks like this:
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
plus any specific ips you may have added so you can access Apache from your network eg.
Allow from 192.168.0

If you are using Apache 2.4.? the syntax changed to 'Require local' which covers all 3 of the above address's and 'Require ip'.
Require local
In the first release of WampServer 2.4, they forgot to make this change to the phpmyadmin/sqlbuddy/webgrind configs so now would be a good time to fix those 3 configs.


If you had other ip address's on your local network add these using this syntax
Require ip 11.22.33.44 55.66.77.88 ( a space delimited set of actual ips )
Require ip 192.168.0 ( for example, every ip in this subnet )


Your php.ini used by Apache
(use wampmanager -> PHP -> php.ini to access this ) it actually lives in \wamp\bin\apache\apachex.y.z\bin\php.ini but dont edit it directly use the wampmanager menu link

Your php.ini used by PHP CLI
only if you actually use the PHP CLI feature ( edit \wamp\bin\php\phpx.y.z\php.ini directly )

Compare your old and new versions, remember things may have changed, extentions added into the core of php and are therefore not required as extensions anymore etc.

Your my.ini.
Again things change, parameters get deprecate, new ones are created etc.
For example if you are using INNODB databases you will have to activate the innodb parameters which are by default commented out.
You may well have to check the mysql website for some information, they supply a How to upgrade page for all releases.
This is just an example [dev.mysql.com]

Once this is all sorted out you can look at restoring your MySQL users and your databases to the new version of MySQL.
Also remember if you are coming from a VERY OLD version of MySQL, this restore process may not be totally straight forward, and you should expect to have to tweek a few things when you find that the new version of MySQL does not like your old data. This is fairly unusual, but may happen. Again dont try and do this 10 minutes before you have to give a presentation using the new WampServer.

Bringing your websites forward to the new release
Now you can just copy your \wamp_old\www\* folders to the new \wamp\www\

Bringing your Virtual Hosts forward to the new release
At this point if you use Virtual Hosts you can bring over your extras\https-vhost.conf from the folder containing the old version of Apache to the new folder containing your new version of Apache.
Remember the instructions in this file may need tailoring to the new release of Apache.
At a minimum, remember to check for the 'Allow from', 'Require' changes, mentioned earlier, and uncomment the 'Include conf/extra/httpd-vhosts.conf' line from your new httpd.conf file.

Bringing old versions of Apache, MySQL and PHP from your old wamp to your new wamp.
Remember one of the best bits of WAMPServer is the ability to swap easily between many versions of Apache, MySQL and PHP.

So now you can bring your old versions of these over to your new WampServer install.

Copy ?:\wamp-old\bin\apache to ?:\wamp\bin
Copy ?:\wamp-old\bin\mysql to ?:\wamp\bin
Copy ?:\wamp-old\bin\php to ?:\wamp\bin

One thing to remember here is that this may be the first time you have installed a WampServer that knows anything about Apache 2.4 and NOT ALL PHP's will run in Apache 2.4
Basically becasue when they were compile and linked they did not know that Apache 2.4 existed, and the linkage between Apache and PHP changed in Apache 2.4.

So in ALL your PHP version installations ?:\wamp\bin\php\phpx.y.z\ there is a file called wampserver.conf
In older releases of PHP it will probably look like this:
<?php

$phpConf['phpIniDir'] = '.';
$phpConf['phpExeDir'] = '.';
$phpConf['phpConfFile'] = 'php.ini';


$phpConf['apache']['1.3']['LoadModuleName'] = 'php5_module';
$phpConf['apache']['1.3']['LoadModuleFile'] = 'php5apache.dll';
$phpConf['apache']['1.3']['AddModule'] =  'mod_php5.c';

$phpConf['apache']['2.0']['LoadModuleName'] = 'php5_module';
$phpConf['apache']['2.0']['LoadModuleFile'] = 'php5apache2.dll';
$phpConf['apache']['2.0']['AddModule'] =  '';

$phpConf['apache']['2.2']['LoadModuleName'] = 'php5_module';
$phpConf['apache']['2.2']['LoadModuleFile'] = 'php5apache2_2.dll';
$phpConf['apache']['2.2']['AddModule'] =  '';

?>

This file tells wampmanager what the PHP interpreter dll is called, that is compatible with which major version of Apache.
This is used when switching between versions of Apache and PHP using the WampManager menus.
The older versions may be missing the linkage instruction for Apache 2.4, so you will need to add this extra piece of code.

However only add this new section if that version of PHP actually has a file called 'php5apache2_4.dll' in its folder.
If one does not exist, and they only exist for versions of PHP > 5.3.17 or there abouts, dont add this new section to wampserver.conf

$phpConf['apache']['2.4']['LoadModuleName'] = 'php5_module';
$phpConf['apache']['2.4']['LoadModuleFile'] = 'php5apache2_4.dll';
$phpConf['apache']['2.4']['AddModule'] =  '';


So if you are running Apache 2.4.x and a version of PHP does not have a php5apache2_4.dll file, you will see a little no-entry icon beside that version when you use the WampManager menus and look at the PHP -> Versions menu. This is a visual queue that you should not switch to this version of PHP when using the currently running Apache version. Of course you can switch the version of Apache you are running to one that is compatible with that version of PHP and the visual queues will change indicating which versions of PHP are not compatible with the new version of Apache.
But remember this mechanism is controlled by the wampserver.conf file that is unique to each version of PHP. You cannot just add the new 2.4 information to every file, but only those versions that actually come with a php5apache2_4.dll. And before you ask, yes I suppose, and olny suppose, it might be possible to re-compile old versions of PHP so thay are all compatible with Apache 2.4 but it is unlikely to happen. Old versions of PHP are old for a reason and you woudl only consider using them if you are trying to make your Development system as similiar as possible to the LIVE environment that your code will be deployed on, or you are using some very old, and probably badly written php code. In that case you woudl almost definitely want to use an older version of Apache as well.



If it all goes horribly wrong and you need to go back to the previous version you had running.

We can go back to your original wamp version by doing:

Start the new wampmanager, and remove the MySQL and Apache services.
wampmanager -> MySQL -> Service -> Remove service
wampmanager -> Apache -> Service -> Remove service
Now stop wampmanager.
rightclick wampmanager -> Exit

rename the current \wamp folder eg. \wamp_new ( or if you are totally giving up you can delete this one and start from scratch again another day. )
rename the \wamp_old folder back to '\wamp'

Start wampmanager, the existing icon on your desktop should still work, and Install the MySQL and Apache services.
wampmanager -> MySQL -> Service -> Install service
wampmanager -> Apache -> Service -> Install service

You should be back to where you were before starting this process.
Remember to clear you browser cache or ( CTRL + F5 ) to ensure you dont get funnies happening.

Options: ReplyQuote


Sorry, only registered users may post in this forum.