Lost all date mysql (XAMPP)

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

Lost all date mysql (XAMPP)

Postby gianni8585 » 14. October 2022 11:46

After "Error: MySQL shutdown unexpectedly", I followed the instructions Rename folder mysql/data to mysql/data_old Make a copy of mysql/backup folder and name it as mysql/data Copy all your database folders from mysql/data_old into mysql/data (except mysql, performance_schema, and phpmyadmin folders) Copy mysql/data_old/ibdata1 file into mysql/data folder Start MySQL from XAMPP control panel

and it worked again. The problem is that my site, I am practicing with xampp, has lost all the changes made in the last few days, and is back in the early stages. I'm desperate, I didn't make a separate backup and I don't know why the last changes made are not showing up. It's like xampp lost almost all the data. Unfortunately, I am a neophyte and don't know what to do-.
gianni8585
 
Posts: 4
Joined: 14. October 2022 11:43
XAMPP version: 3.3.0
Operating System: windows 11

Re: Lost all date mysql (XAMPP)

Postby Nobbie » 14. October 2022 15:22

gianni8585 wrote: I'm desperate, I didn't make a separate backup


That is allways the same problem, people start making backups AFTER they already lost all data, what really hurts.

gianni8585 wrote:and I don't know why the last changes made are not showing up.


Because the database has crashed and the data is lost. The backup folder does NOT hold a backup of the user data, only internal data of MySQL (MariaDB).

From now on, you should make backups on a regular base (daily?!), simply copy the whole Xampp folder to a seperate drive (a USB drive, a NAS or whatever); or at least copy the c:/xampp/data folder. And also run MySQL and Apache as "service" (there is an option in the Xampp Controlcenter). This avoids hard shutdown of MySQL (what causes the damage).
Nobbie
 
Posts: 13221
Joined: 09. March 2008 13:04

Re: Lost all date mysql (XAMPP)

Postby Froosh » 14. October 2022 17:55

I agree with what Nobbie said about failing to make backups, and then having a problem that you want to correct and recover your data.

Not sure what instructions you followed, but it seems like you did not copy the site(s) data folders/files. Assuming you still have the old data, all may not be lost.

From the XAMPP Control Panel stop MySQL and Apache. Copy your site(s) database files from your data_old folder back into the data folder. Then, as Nobbie also mentioned, configure MySQL and Apache to run as Windows Services from the XAMPP Control Panel. Ensure the Services launch, and then hopefully, you will have the data you want.
User avatar
Froosh
 
Posts: 138
Joined: 27. March 2022 17:56
XAMPP version: 8.2.0
Operating System: Windows 11 Pro

Re: Lost all date mysql (XAMPP)

Postby gianni8585 » 16. October 2022 13:18

In a few days I redid everything I had lost. I tried every way but the data was lost. Now as a first step I set XAMPP Control Panel as an administered program, it doesn't give me any more problems at shutdown. Instead when I backup I copy the mysql folder of xampp to another disk, do I backup well this way?
gianni8585
 
Posts: 4
Joined: 14. October 2022 11:43
XAMPP version: 3.3.0
Operating System: windows 11

Re: Lost all date mysql (XAMPP)

Postby Froosh » 16. October 2022 14:34

I hope you also mean you configured MySQL to run as a Windows Service through the XAMPP Control Panel. That is the best way of avoiding issues with database corruption that I am aware of at this time.

For backing up your data in MySQL, you really just need to backup everything in the mysql/data folder (and sub-folders). Before copying the data, I suggest stopping MySQL from the control panel first.

That should cover the data to my best knowledge. Note I think it is also a good idea to backup the various configuration files that are part of XAMPP, as well as any other content you have created under the htdocs folder. You don't need to copy bits you can install again, if you want to save space, though it cannot hurt to back it up as well.

While you can manually do the above, and should if you have no other backup software, I feel backup software makes this process easier and ensure everything is backed up. You just have to use it regularly.
User avatar
Froosh
 
Posts: 138
Joined: 27. March 2022 17:56
XAMPP version: 8.2.0
Operating System: Windows 11 Pro

Re: Lost all date mysql (XAMPP)

Postby gianni8585 » 21. October 2022 14:00

can you tell me what the configuration files are, so in addition to the data folder I also have the configuration files. Yes I have configured the program well now, now it doesn't give me problems when closing.
gianni8585
 
Posts: 4
Joined: 14. October 2022 11:43
XAMPP version: 3.3.0
Operating System: windows 11

Re: Lost all date mysql (XAMPP)

Postby Froosh » 22. October 2022 00:35

At a minimum you should backup any configuration files that you have explicitly modified. For me, I just make sure I backup the configuration I've identified related to MySQL or MySQL, Apache, and PHP, and phpMyAdmin. I believe the list to be complete as of v8.1.10, but you should confirm for yourself. I make regular backups of my system, so I really rely on that to ensure that I have at least reasonably up to date files for xampp and other things on my system.

Here is what I know of configuration-wise for xampp:
apache/conf
I backup everything under apache/config, including sub-folders
mysql/bin
my.ini
mysql/data
my.ini
php
config.inc.php
php.ini
phpmyadmin
config.inc.php
User avatar
Froosh
 
Posts: 138
Joined: 27. March 2022 17:56
XAMPP version: 8.2.0
Operating System: Windows 11 Pro

Re: Lost all date mysql (XAMPP)

Postby gianni8585 » 22. October 2022 10:29

thanks for your help
gianni8585
 
Posts: 4
Joined: 14. October 2022 11:43
XAMPP version: 3.3.0
Operating System: windows 11


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 104 guests