My Ubuntu 16.04 server was recently hacked and my host allowed me to recover the file system via FTP, closing all other ports thus disabling me from logging in and stopping any services. I have the files on a local windows filesystem, which were copied while the server and services were still running.

I have a new Ubuntu 18.04 server, where I have installed MySQL but not WordPress (which is powered by MySQL); most of all, I want my WordPress blog back up on my new server, then I can write a post about the importance of CORRECTLY backing up a database. Can anyone tell me if this is possible and what I should do next?


1 Answer 1


It is not safe or reliable to ftp the files in your MySQL datadir while the MySQL server is running. MySQL keeps part of the data and metadata in memory, and writes them to the files on disk asynchronously. If you try to copy the files, this takes a non-zero amount of time, so you are likely to copy the files while they're being updated by MySQL Server. So you get the early part of the file before the update, and the latter part of the file after the update. The result is potentially an irreconcilable corrupt file.

A simple Wordpress blog is likely to have low traffic, so it's not like it's in a constant state of update. But the risk is still there.

You should work with your hosting provider to give you temporary ssh access. Or ask them to stop MySQL Server on your behalf.

And yes, make backups of your MySQL database regularly. I use jetpack.com to run automatic backups for me.

  • I suspected this would be the case. Thanks for your answer. I may have to get my posts from the wayback machine! Fortunately there are only a dozen or so.
    – hatcat
    May 18, 2021 at 7:55
  • Ha! I had to use wayback machine to recover a personal website once. It's not hard, just time-consuming. May 18, 2021 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.