How to reinstall xampp and keep htdocs and mysql? [SOLVED]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How to reinstall xampp and keep htdocs and mysql? [SOLVED]

Postby evergreenonline » 05. March 2011 20:23

Hi all,

I am quite new to this...

XAMPP has been working great until a couple days ago. I have not made any changes, but can no longer connect to http://localhost and there are no port 80 conflicts. There are no errors in the apache error logs and I am stumped to as what the problem is. I was wondering if there is anyway where i could uninstall and then reinstall the software of XAMPP without losing my mysql database and files in my htdocs folder that are necessary for my site?

Any suggestions and advice would be greatly appreciated!
Thanks!
evergreenonline
 
Posts: 8
Joined: 04. March 2011 06:01

Re: How to reinstall xampp and keep htdocs and mysql?

Postby Sharley » 06. March 2011 05:14

First copy your own files and folders from the htdocs folder to a temporary location - do not save any XAMPP files or folders in the htdocs folder as you will be replacing them when you reinstall - see below for an easier method.

2 ways to save your MySQL data:
Open phpMyAdmin and create a backup sql file of the databases you want to keep.
When you have reinstalled XAMPP you will need to create your databases again then import the backup sql files into those databases you just recreated - so save the user/pass of those databases if you need to keep them the same as you uninstalled ones.

Or an easier solution because you intend to reinstall the same version as you uninstalled.
Copy the \xampp\mysql\data folder to you temporary location that you stored htdocs files and folders. After reinstalling the same XAMPP version simply overwrite the data folder with your saved folder - this method is not recommended if installing a different XAMPP version than you uninstalled.


2 ways to prepare for a reinstall:
Clean uninstall and removal of your current installation.
Run the XAMPP Control Panel and make sure all components are stopped and there are no ticks in the Svc boxes - this is an important step which ever method you use.

Next check you have backed up everything that you need to replace after reinstalling.

Next close the Control Panel - often overlooked and will give issues when trying to reinstall.

Now you can delete the xampp folder completely.


Alternatively and the method I use if I have to reinstall the same version is to always follow the first important step above (make sure all XAMPP components are stopped and the Svc boxes unchecked).

Then instead of deleting the xampp folder simply rename it to xampp_old which also eliminates the steps to backup up your own data, files and folders as all you need do is copy from xampp_old to your reinstalled xampp folder but remember not to copy over any of XAMPP's own files and folders or you may transfer the issues that you are having to reinstalling for.

To check and to make sure that there are no XAMPP components left running like httpd.exe and mysqld.exe use the Windows Task Manager and just to be sure a reboot may help, then check the Task Manager again before you attempt to reinstall XAMPP.


Once you have your new installation up and running as you want it, then you can either keep the xampp_old folder as a backup for your own files or delete it if you need the disk space.



Most of the issues associated with a failed reinstall or even installing a new version after uninstalling an older version relates to most of the points above of making sure nothing is left running either as a Windows service or accidentally forgetting to stop everything first and of course closing the XAMPP Control Panel.

Good luck and best wishes.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: How to reinstall xampp and keep htdocs and mysql?

Postby evergreenonline » 06. March 2011 22:03

Thanks so much for the help!

Sorry im new to this but is there any way to copy the files from the htdocs without possibly corrupting them?
evergreenonline
 
Posts: 8
Joined: 04. March 2011 06:01

Re: How to reinstall xampp and keep htdocs and mysql?

Postby Sharley » 07. March 2011 02:59

evergreenonline wrote:...is there any way to copy the files from the htdocs without possibly corrupting them?
Drag and drop pressing the Ctrl key at the same time to copy files and/or folders.
Drag and drop pressing the Shift key at the same time to move files and/or folders.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: How to reinstall xampp and keep htdocs and mysql?

Postby evergreenonline » 08. March 2011 16:27

Hi sorry to bother again,

Would it be possible to download xampp 1.7.3 on another computer then just drag and drop the htdocs and data files previously mentioned into their respective locations? Would that recreate the site on a localhost?
evergreenonline
 
Posts: 8
Joined: 04. March 2011 06:01

Re: How to reinstall xampp and keep htdocs and mysql?

Postby Sharley » 08. March 2011 16:39

No harm in trying but remember what I said about not copying over any XAMPP files or folders which would include the xampp folder in the htdocs folder and any MySQL files including log files or database folders that are not your own.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: How to reinstall xampp and keep htdocs and mysql?

Postby evergreenonline » 08. March 2011 20:01

I will keep that in mind.

I moved all my htdoc files and replaced the old xampp files, however now I have a HTTP 500 internal server error on my homepage...
Im currently using a joomla site would this affect any of the procedures?

Thanks for all your help!
evergreenonline
 
Posts: 8
Joined: 04. March 2011 06:01

Re: How to reinstall xampp and keep htdocs and mysql?

Postby Sharley » 09. March 2011 00:53

evergreenonline wrote:I will keep that in mind.

I moved all my htdoc files and replaced the old xampp files, however now I have a HTTP 500 internal server error on my homepage...
It is not just a case of keeping the instructions in mind, they have to be implemented as the 500 error sounds like you moved or copied the xampp folder that is in the htdocs folder that I specifically said should not be copied or moved over.

Check in the \xampp\apache\logs\error.log file for clues about the 500 error which may relate to a .htaccess file.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: How to reinstall xampp and keep htdocs and mysql?

Postby evergreenonline » 09. March 2011 13:03

oops!

you're right, I had two xampp folders...I just deleted the old one and now the site is restored! Sorry for my incompetence!

Thanks for all your help, you're a lifesaver!
evergreenonline
 
Posts: 8
Joined: 04. March 2011 06:01


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 98 guests