How can i restore a WordPress site with the DB and WordPress Files

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"