admin管理员组文章数量:1332896
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.) .png
The other one is called database and contains what looks like the content of the "data" folder of a mysql installment. .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?
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/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/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?
Share Improve this question asked Jun 26, 2020 at 0:42 huialxhuialx 1 3- 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 Commented Jun 26, 2020 at 1:08
- There are lots of questions like this on SO, e.g. stackoverflow/questions/484750/… – mozboz Commented Jun 26, 2020 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 Commented Jun 26, 2020 at 17:36
1 Answer
Reset to default 0Incase 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 typingmariadbd.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"
本文标签: databaseHow can i restore a Wordpress site with the DB and Wordpress Files
版权声明:本文标题:database - How can i restore a Wordpress site with the DB and Wordpress Files 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742310847a2450837.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论