SuperEZSystems

Database rendition

How We Repaired A WordPress Database Crash After Site Migration

HI Jim,

 

Hope your weekend is going well

 

When trying to add a new post in WordPress, the site times out.

 

I drilled down and it looks like a really quick fix – please provide a fix at your earliest convenience. (see SG support response below)

 

Hello Mitch,

 

Thank you for contacting our Help Desk center!

 

I checked your website and I noticed that upon creating a new post the page is loading with 404 page not found.

 

This is why I checked the setup of the website I noticed that there are two URLs applied for it:

Editor’s note: after moving from a dedicated server to the AWS cloud we found our selves unhappy with overall site security.

Without missing a beat we moved our double databases to SiteGrounds cloud hosting

Endnote

 

Code:

[email protected] [~/public_html/windycityparrot.com/wordpress]# wp option get home

https://www.windycityparrot.com/blog

[email protected] [~/public_html/windycityparrot.com/wordpress]# wp option get siteurl

https://www.windycityparrot.com/wordpress

 

Please allow me to explain that the website is currently set to load from a folder called WordPress so both of the settings should be WordPress and not blog.

 

I would suggest considering setting the website to load over the correct URL and if there are any specific modifications applied to it you could contact your website developer so he/she could set them on your behalf.

 

If we could be of any further help, do not hesitate to let us know.

 

Best Regards,

Maria Genova

Technical Support Team  

 

  to James

 

can you help me with this Jim?

 

 

to Mitch

 

Let me see what I can do.

 

Their instructions are wrong.

 

The site is in the WordPress folder but displays as blog, so that part is correct.

 

James King – Wheaton Website Services

 

 

Mitch,

 

I’ve updated the ticket with SiteGround.

 

We’ve tried a number of things but have not solved this issue.

 

The previous problem was solved was due to a database error.

 

I suspect this is too. Maybe some sort of corruption when exporting/importing it.

 

I tried to be a fresh copy from WolfPaw but it seems your account has been removed.

 

Any chance you have a backup or copy? Or can you ask Jeff if there is some still on his server?

 

 

to James

 

Ok I’ll reach out to WolfPaw.

 

Let me know what Site Ground says to the ticket.

 

 

to James

 

just tried to log into WP – wants a DB update – shall I proceed or are you on the case?

 

 

to Mitch

 

You can’t, that’s the problem. The details are in the ticket I updated this morning.

 

 

Mitch,

 

Thank you for the update.

 

From SiteGround Tier One support

 

We strive to provide the best possible hosting service and to assist our clients with server-sided requests or issues, as well as application-based debugging.

 

That being said, some issues are very custom and require deeper development skills to be diagnosed and resolved.

 

After further checks, we determined that the server and the services running on it are all functioning correctly.

 

They are not the cause of the issue at hand.

 

Also, the usual application debugging methods that we tried in your case did not cause any improvement to the situation.

 

As much as we want to further assist you, sadly we will not be able to do so.

 

At this point I suggest you consult with a professional developer who will be able to invest the skills and time required for debugging such issues.

 

Of course, if any server-sided assistance is required during the debugging process you are more than welcome to contact us again or have your developer contact us.

 

In case you do not have a trusted developer, I recommend you turn to our partner Codeable.

 

Codeable is a WordPress exclusive freelancer platform that connects thousands of customers like you with WordPress freelance experts to work on WordPress projects of any size.

 

We recommend them for the high-quality development services they offer.

 

As a SiteGround client, you’ll get a $60 discount on your first project posted with Codeable. If you are interested, you can find more information on this page

 

Best Regards,

 

Dimitar Ruzhinov

Senior Technical Support

 

 

Mitch,

 

Thanks for forwarding.

 

“Also the usual application debugging methods that we tried in your case did not cause any improvement to the situation.”

 

My question wasn’t to fix it. 

 

We need to know what the application error is so we can continue troubleshooting. 

 

to James

 

I think they were correct here – are you able to try to get both to load from WordPress?

 

[email protected]54875 [~/public_html/windycityparrot.com/wordpress]# wp option get home

https://www.windycityparrot.com/blog

[email protected] [~/public_html/windycityparrot.com/wordpress]# wp option get siteurl

https://www.windycityparrot.com/wordpress  

 

We could restore the site back a day or two prior to this new problem happening (file wizard in cpanel)?

 

Mitch

 

Nope. 🙂  Those settings are correct.

 

You have WP installed in ‘WordPress’ but displays as ‘blog’.

 

That’s what these settings do.

 

We could do a restore that would get you back into the admin.

 

We’d still need to know the error message(s) in order to get WP working correctly again. 

 

This is why it’s good to keep the old hosting account active long enough to know the new one is working ok. It would be very helpful to get a copy of the original database for comparisons.

 

Jim,

 

Please excuse me for the confusion.

 

The message Database Update Required usually indicates that some form of update occurred in the WordPress core version.

 

When this happens WordPress needs to reload many entries in its database.

In your case, the error indicates that the Update process is entering a loop and eventually is killed by the server timeout limit.

 

The server has many timeout limits that protect it against long and sluggish processes.

 

If there was no timeout limit the process would have continued indefinitely completely exhausting the server resources.

 

The loop issue is usually caused by the incompatibility of a plugin or a theme with the newer WP version.

 

I would suggest you to check these discussions on-line on possible fixes:

 

https://wordpress.org/support/topic/wp-5-1-update-continually-returns-to-the-database-update-status-page/

 

https://stackoverflow.com/questions/17308436/wordpress-error-database-update-required/23506630

 

https://wordpress.stackexchange.com/questions/20144/site-stuck-in-database-update-required-loop

 

Of course, if anything else comes up do not hesitate to contact us again.

 

Best Regards,

 

Dimitar Ruzhinov

Senior Technical Support

 

Dimitar,

 

Thanks for the reply. Glad we are on the same page now.

 

We’ve tried disabling all the plugins and switching themes, the same result.

 

I’m expecting there is some error to go along with the update loop.

 

Without that, we’re just blindly testing all kinds of possibilities.

 

Could you check to see if *any* errors are being created while it’s in this loop?

 

You can try the update button if that helps in identifying them.

 

Thanks,

Jim

 

Hello Mitch,

 

I’ve checked the Apache error logs on the server, however, they don’t contain any errors related to the database update loop.

 

I’ve noticed, however, that when I try to repair the database via WP-CLI, the process stalls on this table:

Code:

wp_pmxe_templates

 

Before taking any further actions, I created a backup of the entire database:

Code:

/home/mitchr76/public_html/windycityparrot.com/wordpress/mitchr76_wpwcp-2019-10-14-6dcdcf5.sql

 

and a backup of only the wp_pmxe_templates table:

Code:

/home/mitchr76/public_html/windycityparrot.com/wordpress/wp_pmxe_templates.sql

 

After that, I dropped this particular table via cPanel -> phpMyAdmin.

 

After that I tried to repair the database again, however, the process stalled on a different table – wp_pmxe_posts.

 

I then noticed that there are more than 40 stuck queries towards the website’s database.

 

Some of the queries have been stuck for more than 69 hours:

Code:

+———+——————+——————————————+———————+———+——–+——————————+——————————————————————————————————+———–+—————+

| Id | User | Host | db | Command | Time | State | Info | Rows_sent | Rows_examined |

+———+——————+——————————————+———————+———+——–+——————————+——————————————————————————————————+———–+—————+

| 1383116 | mitchr76_zenuser | c-73-74-48-105.hsd1.in.comcast.net:58431 | mitchr76_zencartwcp | Sleep | 10 | | | 1 | 0 |

| 1501834 | mitchr76_zenuser | localhost | mitchr76_wpwcp | Query | 252155 | Sending data | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta ON (wp_posts.ID = wp_po | 0 | 203643672850 |

| 1502082 | mitchr76_zenuser | localhost | mitchr76_wpwcp | Query | 251926 | Waiting for table level lock | UPDATE `wp_postmeta` SET `meta_value` = ‘1570834608:2’ WHERE `post_id` = 2161 AND `meta_key` = ‘_edi | 0 | 0 |

 

In order to resolve this, I can restart the MySQL service, however, please note that this will terminate all current queries, regardless of the fact if they have finished successfully or not.

 

If this is agreeable with you, please confirm in this ticket.

 

Best Regards,

Svetoslav Vasev

Technical Support Team

 

Svetoslav,

 

I appreciate the effort and detailed information. Yes, you may restart MySQL. Thanks for checking first.

 

Jim

 

I’m glad to inform you that restarting the MySQL service resolved the issue and the website’s database has been successfully updated.

 

You can now log into the backend without issues.

 

Make sure to clear your browser’s cache before verifying the results on your end.

 

Best Regards,

Svetoslav Vasev

Technical Support Team

 

Wonderful, thank you for your help Svetoslav.

 

You’re most welcome Jim.

 

If you need further assistance or have any additional questions, feel free to contact us again by submitting a new ticket from your User Area.

 

Best Regards,

 

Svetoslav Vasev

Technical Support Team

 

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.