Due to some circumstances i ended up with 2 folders and the task to restore a wordpress site. One folder is called html and contains what i assume all the necessary files for the wordpress site (such as wp-admin, wp-content etc.) https://i.imgur.com/IE3cevR.png

The other one is called database and contains what looks like the content of the "data" folder of a mysql installment. https://i.imgur.com/tprbCyo.png

What i have tried is to restore the database so i can make a proper backup to load it into a new installation of wordpress as i assume that i than can just copy the other folder over and everything will run. For this i tried to copy the contents into the data folder of a fresh mysql install and start the service in hopes it would restore the db but unfortunatly the service doesn't start this way. Next i tried starting mysqld with the --innoDB-force-restore but this unfortunalty also ends in failure as this just crashes mysqld. Is there any easy way i don't know of to restore the wordpress site or does anyone have any tips how i can succesfully restore the db?

  • This isn't really a Wordpress question as the main problem you have is how to restore a MySQL db from MySQL files, which may be a bit tricky. You'll probably get better responses by going to e.g. stackoverflow and asking how to restore a mysql from the files, not from a backup. Once you can login with the mysql client and look at the tables then you're good to go. (You'll find the credentials for the database in wp-config.php) – mozboz Jun 26 at 1:08
  • There are lots of questions like this on SO, e.g. stackoverflow.com/questions/484750/… – mozboz Jun 26 at 1:10
  • @mozboz thanks for the link. This is basicly what i have tried but i guess ill try it again in a linux enviroment. To keep it to wordpress, once i restored the db will i just have to copy over the files form the first folder into a fresh wordpress and everything will work as it should or do i have to do more steps to make it run again? – huialx Jun 26 at 17:36

Incase someone stumbles across the same problem, here is how i managed to restore my db. I tried many different versions of mysql but all of them refused to start. The best i managed to do was to get it to start but with missing table contents by deleting the ibdata1 files.

Switching from windows to linux (since i knew the original db was running on a linux server i thought this might be worth a try) didn't help either.

In the end i tried to install MariaDB (since it supports all features of MySQL and adds some of its own) and it worked.

Here are the steps:

  • Install MariaDB
  • Start it by navigating your cmd console into the bin folder of the installation and starting it by typing mariadbd.exe --console.
  • this will create the data structure. now you can close the cmd box
  • move the contents of your old db into the data directory ( in my case C:\Program Files\MariaDB 10.5\data)
  • now restart the service as mentioned above
  • you should now be able to login and see your old db with all of it's data accesable

From here on i recommend making a proper backup using mysqldump.exe:

  • again navigate a cmd into the bin folder (C:\Program Files\MariaDB 10.5\bin)
  • with this command you can create a sql file that you than can import into your wordpress server mysqldump.exe --user=YourUserName --password=YourPassword --host=localhost --port=3306 --result-file="Pathdump.sql" --databases "DatabaseName"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.