Importing WordPress from 'dead' server
-
Hello everyone!
About a month ago my server died, however a friend managed to get access to recover some important files. among those was the mysql database & wordpress, both needed for my website.
Sadly im experiencing issues with replacing those files. I tried to install the same versions of all programs needed and did this using the yum.log from the old server. But whatever I do, whatever I replace and however I do it it still comes up with the default page.
This is what I did:
Install apache, mariadb, mysql, wordpress
Then I used these commands to copy the files from the backup to the correct locations.
rsync -aAHX /home/oldhdd/var/lib/mysql/wordpress/ /var/lib/mysql/wordpress/
rsync -aAHX /home/oldhdd/var/www/html/ /var/www/html/I restarted mariadb and httpd with the following commands:
systemctl restart httpd
systemctl stop mariadb
systemctl start mariadbWhen i reloaded the page it didnt showed any changes.
-
You don’t mention reloading your WordPress MySQL database.
In general, here is the place to start, for info on Restoring the WordPress database:
http://codex.wordpress.org/Restoring_Your_Database_From_BackupI’ve followed the tutorial, needed to install phpmyadmin. I had issues with that before but succeeded in installing it.
Anyway, I’ve tried zipping the content of /mysql/wordpress with the name sql.zip however when I glick the go button on phpmyadmin it says:
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘? ’ at line 1
Folder Image: http://www.mijnalbum.nl/Grotefoto-EHFBP4ML.jpg
So much depends on how the original backup was created that there is no simple answer to your question. Other than to say:
Look around those folders and compressed files (.zip or .gz) for a file with the Extension .sql. It is much easier if you give phpmyadmin a .sql file than something that is compressed.
You may also want to look at the first few lines of the .sql file and see if “it looks like” a WordPress database. Table Names normally begin with “wp_”
The backup wasn’t created. The server’s boot went corrupt thus making it unable to access the files using the regular way. However, a friend succeed in mounting the HDD which boot was corrupt. From there he uploaded the whole server’s content to his own server.
I managed to restore most of the data to a working state except for the mysql databases. If I understood correctly these files are located in /var/lib/mysql/ However, phpmyadmin doesnt reconize these files as databases and sadly I dont have the experience to determine which files are actually mysql database files.
Here is a picture of what file types I found within the /var/ib/mysql/wordpress/ file:
http://www.mijnalbum.nl/Grotefoto-AAONRTTM.jpg
I tried zipping these files and importing them to phpmyadmin, sadly this didnt worked. A plain copy caused a big error file. I can reproduce the issue and provide the adress of the website if this may help.
Thanks for your patience and help!
I’ve tried putting the wp_ files back in and doing a backup with this command:
mysqldump -u root -pmypassword wordpress > wordpress.sql
It gave me this error:
mysqldump: Got error: 1146: “Table ‘wordpress.wp_maxbuttons_buttons’ doesn’t exist” when using LOCK TABLES
When using the mysqlcheck -u mysql_username -p database_name command i get this output:
[root@ns321835 ~]# mysqlcheck -u root -p wordpress
Enter password:
wordpress.wp_cis_categories
Error : File ‘./wordpress/wp_cis_categories.frm’ not found (Errcode: 13)
status : Table is already up to date
wordpress.wp_cis_images
Error : File ‘./wordpress/wp_cis_images.frm’ not found (Errcode: 13)
status : Table is already up to date
wordpress.wp_cis_sliders
Error : File ‘./wordpress/wp_cis_sliders.frm’ not found (Errcode: 13)
status : Table is already up to date
wordpress.wp_commentmeta OK
wordpress.wp_comments OK
wordpress.wp_links
Error : File ‘./wordpress/wp_links.frm’ not found (Errcode: 13)
status : Table is already up to date
wordpress.wp_maxbuttons_buttons
Error : Table ‘wordpress.wp_maxbuttons_buttons’ doesn’t exist
status : Operation failed
wordpress.wp_ngg_album
Error : Table ‘wordpress.wp_ngg_album’ doesn’t exist
status : Operation failed
wordpress.wp_ngg_gallery
Error : Table ‘wordpress.wp_ngg_gallery’ doesn’t exist
status : Operation failed
wordpress.wp_ngg_pictures
Error : Table ‘wordpress.wp_ngg_pictures’ doesn’t exist
status : Operation failed
wordpress.wp_options OK
wordpress.wp_postmeta OK
wordpress.wp_posts OK
wordpress.wp_schreikasten
Error : Table ‘wordpress.wp_schreikasten’ doesn’t exist
status : Operation failed
wordpress.wp_schreikasten_blacklist
Error : Table ‘wordpress.wp_schreikasten_blacklist’ doesn’t exist
status : Operation failed
wordpress.wp_term_relationships OK
wordpress.wp_term_taxonomy OK
wordpress.wp_terms OK
wordpress.wp_usermeta OK
wordpress.wp_users OK
wordpress.wp_wangguardcronjobs
Error : Table ‘wordpress.wp_wangguardcronjobs’ doesn’t exist
status : Operation failed
wordpress.wp_wangguardquestions
Error : Table ‘wordpress.wp_wangguardquestions’ doesn’t exist
status : Operation failed
wordpress.wp_wangguardreportqueue
Error : Table ‘wordpress.wp_wangguardreportqueue’ doesn’t exist
status : Operation failed
wordpress.wp_wangguardsignupsstatus
Error : Table ‘wordpress.wp_wangguardsignupsstatus’ doesn’t exist
status : Operation failed
wordpress.wp_wangguarduserstatus
Error : Table ‘wordpress.wp_wangguarduserstatus’ doesn’t exist
status : Operation failed
wordpress.wp_wowslider
Error : Table ‘wordpress.wp_wowslider’ doesn’t exist
status : Operation failedthis is the list when i used show tables:
MariaDB [(none)]> use wordpress
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
MariaDB [wordpress]> show tables;
+—————————+
| Tables_in_wordpress |
+—————————+
| wp_cis_categories |
| wp_cis_images |
| wp_cis_sliders |
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_maxbuttons_buttons |
| wp_ngg_album |
| wp_ngg_gallery |
| wp_ngg_pictures |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_schreikasten |
| wp_schreikasten_blacklist |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_terms |
| wp_usermeta |
| wp_users |
| wp_wangguardcronjobs |
| wp_wangguardquestions |
| wp_wangguardreportqueue |
| wp_wangguardsignupsstatus |
| wp_wangguarduserstatus |
| wp_wowslider |
+—————————+
26 rows in set (0.00 sec)MariaDB [wordpress]>
Found a handy guide to solve this issue:
This issue will also occur after restoring databases from a, backup of all mysql data folders)
One possible pre-solution to this issue is ,
1. should copy the mysql data folder (/var/lib/mysql — linux OR C:\ProgramData\MySQL\MySQL Server 5.1\data — windows)
2. in the new server stop the mysql and paste all the folders pertaining to different databases , except the main “mysql” database.
3. make sure to copy and paste “ibdata1” file from the backed up folder into the new server “mysql data folder”.
4. make sure to give permission to “mysql” user for that file (windows user need not worry).
5. restart mysql you should be able to see all the backed up databases correctly configured , and you should be able to access the table data without getting that error (1146).I’ll try it out!
This didnt worked…
Whenever I try to put ibdata1 in the sock file dissapears resulting in this issue:
Job for mariadb.service failed. See ‘systemctl status mariadb.service’ and ‘journalctl -xn’ for details.
When using the check command:
mysqlcheck: Got error: 2002: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) when trying to connect
4. make sure to give permission to “mysql” user for that file (windows user need not worry).
Are you sure this was done properly?
GRANT ALL ON wordpress.* TO root@localhost IDENTIFIED BY ‘password’;
root is the mysql user i assume, I’ve used that for the sudo mysql_secure_installation
and use mysql -u root -p to login
Also, for now I’d like to get everything to work again, then after everything is complete I will do a more secure installation of… well everything using multiple users. Im currently focussed on getting everything working as quick as possibile
Issue solved, my friend helped me out. By the looks of it he seems to have restored the previous server. This included a huge load of malfunctions and errors, I’m probally facing another crash the upcoming weeks. However I made a backup of the Mysql database of wordpress using phpmyadmin export function.
I will reinstall the whole server and make sure it gets installed correctly to improve the systems stability & safety.
Thanks for your help anyway π
The topic ‘Importing WordPress from 'dead' server’ is closed to new replies.