Page 1 of 1

Retrieving mysql database from XAMPP application folder

PostPosted: 26. November 2023 17:55
by sbro03
Hi, I'm new in trasfering files from XAMPP to other pc or operating system. I want to explain my problem step by step.
I had a PC in which I was working on a website for work, and I was using XAMPP. Everything worked perfectly until I decided to change PC: I have done a backup of every file and folder of my old pc but I forgot one important thing, doing a backup for my database from phpmyadmin, Murphy laws strikes again :( . So I have the application folder of XAMPP from my old pc but not a single .sql file for backup. So my question is: there is a way to get back my old databases from the application folder in a similar way to copying files from /htdocs ?

PS. I've even tried to open the application from the folder but obviously the pathname of everything inside is related to my old pc. This is where is the folder in my new and old pc, idk if this can help.
OLD PC: D > Programs > XAMPP (WINDOWS 10)
NEW PC: C > User > myname > Desktop > XAMPP (WINDOWS 11)

I thank whoever can help me with this problem

Re: Retrieving mysql database from XAMPP application folder

PostPosted: 27. November 2023 20:50
by Nobbie
The Database is stored in Subfolder "data", i think its a subfolder of "mysql" folder in Xampp (not sure, but there is only one "data" subfolder).

You can copy that whole folder to your new installation. You have to stop Xampp therefore, rename the existing data folder (for example rename it to "data-backup" or so) and finally copy the whole data folder from your old installation into the new installation.

An important remark to your (very crazy!) installation folders:

It is NOT recommended to install Xampp into your User space. But its exactly what you did. C > User > myname > Desktop > XAMPP (WINDOWS 11) is the WORST(!) installation folder i can think off. As you can find in this forum, the contents of MariaDB very often gets lost due to unknown errors. If you want to avoid losing all your data, you MUST run MariaDB as a Windows Service. You can do this simply by putting a cross in the Xampp Control Center before MariaDB (you will see it immediately).

BUT: if you run MariaDB (and Apache) as a Service, it is executed by "System" User. But this System User does not have any rights to access your Userspace. Therefore it will not work to run MariaDB as a Service. You REALLY should install Xampp into C:/Xampp as recommended, why didnt you follow that recommendation? To install Xampp into the Desktop(!) is a pain (sorry, but it is). So before you are going to copy the data folder, you really should install Xampp at a better location.

Re: Retrieving mysql database from XAMPP application folder

PostPosted: 28. November 2023 12:10
by sbro03
thanks a lot, I will try to follow your advices. Yeah I know putting the folder in Desktop folder is not the best but it was the folder from my old pc and I put it there for convenience in order to see immediately. Another time, thanks a lot man :D

Re: Retrieving mysql database from XAMPP application folder

PostPosted: 28. November 2023 19:00
by sbro03
thanks a lot!!!! I tried it and it was a success! You have saved my work and job, I really appreciate that! :D

Re: Retrieving mysql database from XAMPP application folder

PostPosted: 28. November 2023 19:26
by Nobbie
Dont forget to do a backup now!