• Resolved jb317

    (@jb317)


    Hello.

    I tried to do a restore and I received a 527 error on the screen. Now I have no access. I can only get “Error establishing a database connection.”

    I went ahead and tried the manual way of restoring via ftp, but the same thing occurs after that. “Error establishing a database connection.”

    Here is the log file from the time of restore attempt:

    <script src=”https://pastebin.com/embed_js/5eXV8gM9″></script&gt;

    This is infuriating. Please help. Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter jb317

    (@jb317)

    I figured out the issue, but don’t know how it happened or how to fix it. Some of the database table prefix after restore are: wpstg0_ instead of wp_ .

    And yes, the backups were made by Updraft. Here is another guy with the same issue last year: https://updraftplus.com/forums/topic/database-restore-sql-syntax-error/

    Please advise.

    • This reply was modified 5 years, 3 months ago by jb317.
    Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    Apologies for the inconvenience.

    It appears that there is an issue with the WordPress database prefix during the restoration.

    Please could you let us know what prefix is configured in the site’s wp-config.php file?

    If possible, please could you also send us a copy of the backup log for the set you are attempting to restore?

    Thread Starter jb317

    (@jb317)

    The prefix in the config was wp_. However, in order to get me back online with an incredibly broken site, my host had to change some pre-fixes in the database and also make the prefix in the config to wpstg0_ .

    Once that was done, I was able to access admin again. My site was wrecked!!!!!!! Thankfully, THANK GOD, I was able to uses the plugin to restore from the next previous backup. This fixed my site.

    I cannot tell you what a disaster yesterday was because of this. I lost an entire day of my life because of this, trying to get it fixed, along with lost revenue from the day.

    So, right now, I see tables in my DB with prefix wp_ and tables with wpstg0_ . The config file is still set to wpstg0_ . I have no idea how to fix the entire DB to be the proper wp_, nor if doing so will break everything again. At this point, I am terrified to change anything.

    I am not sure which log file you want at this point. I just want to know why my database prefix was changed to wpstg0_ (which are clone or staging files, from my googling). How can I get back to everything being wp_, without breaking anything, and preventing this from ever happening to me or anybody else ever again.

    Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    It appears that your server admin has moved the site over to use the staging site database tables, as these were unaffected by the broken restoration.

    After checking through the log again, it appears that the issue may have been caused by a race condition in the database (where the database was updated while the restoration process was running).
    This caused a duplicate entry error when restoring the wp_options table, leaving that table in a broken state.

    To restore the site back to working order with the original prefix, there are two options:

    • If you or your host are able, import the database backup file into the database using phpMyAdmin (i.e. manually restore the database file). This can be dine using the phpMyAdmin ‘Import’ feature.
      The prefix in wp-config.php can then be switched back to ‘wp_’
    • Clear the broken ‘wp_’ database tables from the database, and reset the prefix to ‘wp_’. Then, set up WordPress again and activate UpdraftPlus. This will allow you to attempt the database restoration again.
    Thread Starter jb317

    (@jb317)

    Thank you for the reply.

    This sounds very risky to me (though, it may not be).

    What happens if I just leave the site as it is now? Will it continue to work and function as normal? Is there long term harm to operating this way?

    Thread Starter jb317

    (@jb317)

    I already had uploaded the backup database file the other day.

    What I did today was to change the prefix of the staging database manually to a new one, then updated the wp config. I also updated the options and user meta tables to reflect the new prefix.

    All seems to be working.

    How can I prevent this from happening again?

    Plugin Contributor bcrodua

    (@bcrodua)

    Hi,

    Apologies for the late reply.

    Glad you were able to resolve the issue. As stated by my colleague the cause was the database was updated while the restoration was still running.

    Just ensure that there are no other processes are running during the restoration.

    Regards,
    Bryle

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Another Broken Site After Restore Attempt (527 Error)’ is closed to new replies.