How to upgrade without loosing data

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

How to upgrade without loosing data

Postby dogslife » 11. January 2010 22:30

After reading the install instructions for 1.7.x, there is that scary little note: "Notice: all old installations of XAMPP for MacOS X will be overwritten!"

I've been successfully using 1.0.1 for a while now, but I'd like to upgrade. How do you upgrade without overwriting your data?
dogslife
 
Posts: 2
Joined: 09. June 2009 15:39

Re: How to upgrade without loosing data

Postby MegaChriz » 12. January 2010 10:31

Step 1: make a backup of your data

Minimal:
1.1. Make a backup of all your files inside the htdocs-folder.
1.2. Go to phpMyAdmin, and export all your databases one by one. Export them as SQL-files. Don't forget to turn on the 'Send'-checkbox at the bottom of the export-page or else the data of the database will be displayed in a textarea-field instead it will be downloaded to a file.
1.3. If you've made changes in other folders then the htdocs-folder, such as in httpd.conf or in php.ini, remember what you had changed there.

Safer:
Do step 1.2 and 1.3 of above, plus:
1.4. Make a backup of your complete XAMPP installation (a backup of the folder /Applications/XAMPP).
1.5. Rename the folder of XAMPP into (for example) XAMPP101 (you may need to type a password of your administrator account).

Step 2: Install new XAMPP version
2.1. Place the new XAMPP-installation into the Applications-folder.
2.2. From the backup, put your files back into the htdocs-folder.
2.3. Go to phpMyAdmin and restore your databases one by one. For each database, you need to create one first and after that you will need to import the files you had exported in step 1.2.
2.4 Reconfigure your XAMPP-installation, for example make the nessacery changes in php.ini or httpd.conf. You may also need to add users to MySQL as well if that was needed for your websites. If you didn't had extra users in MySQL in your previous XAMPP-installation, then adding users is not needed.
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X

Re: How to upgrade without loosing data

Postby dogslife » 13. January 2010 15:02

Thank you very much!
dogslife
 
Posts: 2
Joined: 09. June 2009 15:39

Re: How to upgrade without loosing data

Postby MiG » 19. January 2010 11:03

MegaChriz wrote:2.4 Reconfigure your XAMPP-installation, for example make the nessacery changes in php.ini or httpd.conf. You may also need to add users to MySQL as well if that was needed for your websites. If you didn't had extra users in MySQL in your previous XAMPP-installation, then adding users is not needed.

I only have one or a few users on each of my machines so recreating them isn't much of a problem, but shouldn't exporting and importing SQL databases also include users and their privileges? I can't quite imagine people running huge databases recreating thousands upon thousands of users after each upgrade.
MiG
 
Posts: 1
Joined: 22. June 2009 18:37

Re: How to upgrade without loosing data

Postby MegaChriz » 20. January 2010 13:30

@MiG
There is also a database called 'mysql'. This database contains a table called 'user'. It might work to export that table as well from the old installation and import that in the new installation, but I didn't test that (I've only a few mysql-users). I think you should be carefull with that, because I don't know if something had changed in the way MySQL interacts with that database after upgrading. If you for example upgrade from MySQL 5.0 to MySQL 5.1 it is possible that there were changes in the table-structure.

I don't know how people with huge databases upgrade their database-software, but probably with an upgrade-application (after making a good backup first of course). Currently the only way to upgrade XAMPP is in fact doing a fresh install of the new XAMPP.
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X

Re: How to upgrade without loosing data

Postby wkelvinf » 13. March 2010 14:40

@MegaChriz: was it really necessary to export all the databases?
I simply backed up my existing xampp folder, downloaded the new zip file and unzipped it into the current xampp folder.
Then I manually adjusted some files that were overwritten.
All my databases remained the same after the process.
wkelvinf
 
Posts: 8
Joined: 13. March 2010 14:16

Re: How to upgrade without loosing data

Postby MegaChriz » 15. March 2010 10:23

@wkelvinf
I did that once in the past, when changing from XAMPP v0.5 to XAMPP v0.7.2. The mysql-databases remained, but some of the data got corrupted. The data in columns of the datetime-type wasn't readable anymore. (Maybe I didn't set back the databases in the right way. I just copied some of the database-folders inside /Applications/xampp/xamppfiles/var/mysql to the new installation. I only copied what I wanted to keep.)
So that's the reason why I prefer to export all the databases.
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 5 guests