I have a Raspberry Pi that does not boot anymore on which I have an hosted website.
My plan is to reinstall the whole Raspbian system on it, but before that, I would like to recover my Wordpress website that is installed on it. So I managed to mount the SD on my laptop (under Manjaro Linux), from which I have to recover the website folder that I already manage to copy (/var/www/html/mywebsite
).
The problem concerns the SQL database linked to this website that is stored into /var/lib/mysql/mywebsitedb
. I would like to save it as a .sql
file. But I cannot use the mysqldump
function that I could use for it if I was able to run the Raspberry Pi and ssh access.
The option I found was to clone the database from the folder of the SD card /run/media/$USER/rootfs/var/www/html/mywebsite
, to my laptop repository /var/lib/mysql
this way :
rsync -av /run/media/$USER/rootfs/var/lib/mysql/mywebsitedb /var/lib/mysql
sudo chown --recursive mysql:mysql /var/lib/mysql/mywebsitedb # Giving access to mysql
I did it and it worked without any problem. When I do,
USE mywebsitedb;
SHOW TABLES;
I have no problem to see the tables. But the problem comes when I try to extract mywebsitedb
with mysqldump
this way :
mysqldump -u root -p mywebsitedb > /home/$USER/mywebsitedb.sql
I receive the following error message :
mysqldump: Got error: 1932: "Table 'mywebsitedb.mywebsite_commentmeta' doesn't exist in engine" when using LOCK TABLES
And I did not find a solution to this problem until now. Thanks in advance !
EDIT
The tables are made of a mix of .idb
and .frm
files. For each .idb
file there is a .frm
file of the same name.
ls -lah mywebsitedb # Gives the following :
drwx------ 2 mysql mysql 4,0K 21 nov. 21:52 .
drwx------ 6 mysql mysql 4,0K 12 déc. 14:02 ..
[...]
-rw-rw---- 1 mysql mysql 3,6K 21 nov. 21:52 mywebsite_terms.frm
-rw-rw---- 1 mysql mysql 128K 4 déc. 18:05 mywebsite_terms.ibd
-rw-rw---- 1 mysql mysql 2,2K 21 nov. 21:52 mywebsite_term_taxonomy.frm
-rw-rw---- 1 mysql mysql 128K 4 déc. 18:05 mywebsite_term_taxonomy.ibd
-rw-rw---- 1 mysql mysql 3,0K 21 nov. 21:52 mywebsite_usermeta.frm
-rw-rw---- 1 mysql mysql 128K 10 déc. 21:28 mywebsite_usermeta.ibd
-rw-rw---- 1 mysql mysql 6,8K 21 nov. 21:52 mywebsite_users.frm
-rw-rw---- 1 mysql mysql 144K 4 déc. 18:05 mywebsite_users.ibd
-rw-rw---- 1 mysql mysql 67 21 nov. 21:49 db.opt