Accidentally deleted Mysql database of wordpress, [HELP]

7 replies
  • WEB DESIGN
  • |
Hello, So I accidentally deleted mysql database of my wordpress, but My site is still running, I can access all the file in the filezilla but I just can't access the admin area of wordpress to make any changes.

I did made a back up few months ago, I don't want to back up the whole site from the older version because I have much less content on my back up . Is it possible to copy ONLY the mysql data from the old version of wordpress?

So how can I recover my database without losing any content. thanks.
#accidentally #database #deleted #mysql #wordpress
  • Profile picture of the author bluejeans
    Originally Posted by Lobsang View Post

    Hello, So I accidentally deleted mysql database of my wordpress, but My site is still running, I can access all the file in the filezilla but I just can't access the admin area of wordpress to make any changes.

    I did made a back up few months ago, I don't want to back up the whole site from the older version because I have much less content on my back up . Is it possible to copy ONLY the mysql data from the old version of wordpress?

    So how can I recover my database without losing any content. thanks.
    Have you contacted your host to see if they have a recent version of your site prior to deletion?
    {{ DiscussionBoard.errors[10505852].message }}
  • Profile picture of the author Sahana Chawla
    Contact your host and ask them to restore the database..
    {{ DiscussionBoard.errors[10506562].message }}
  • Profile picture of the author Yvon Boulianne
    yes or you can just unzip your backup and you will find a .sql files so you go in your Cpanel, in your database tool and you just restore the .sql
    it won't be perfect as the .sql don't have your new post and modifiation but it's better than nothing...

    Good Luck
    Signature
    Stop Struggling With Your Website and Marketing
    30$ / task, pay after done!
    {{ DiscussionBoard.errors[10506736].message }}
  • Profile picture of the author Techalo
    Hi Lobsang,

    You most like used some sort of 'Cache' plugin on your website, which explains why the site is still available even after deleting your database. Surprised nobody above mentioned that - must be trying to boost post counts :/

    Here's the thing when it comes to losing content based off your current predicament:
    1.) Content/Design changes made within your source files (the files you see in filezilla) will not be affected by losing your database.
    2.) Any content that was changed through the WordPress CMS (E.g. you added a new page/images/text etc) WILL BE LOST, as this information is stored in the database.

    I know that's probably not what you wanted to hear, sorry.

    I would recommend you contact your hosting provider, and ask them to provide you with the most recent SQL backup. Then import the SQL file through phpmyadmin - this way, your source files aren't restored to a previous backup, in case you made any changes.

    Hope this helps!

    Best,
    Will
    {{ DiscussionBoard.errors[10507499].message }}
  • Profile picture of the author sbucciarel
    Banned
    Yep. Restoring only the database won't work unless it is a recent database. The content to your blog is stored in the database. See if your host has a more recent backup of the database. All you can do really.
    {{ DiscussionBoard.errors[10507515].message }}
  • Profile picture of the author trevordd
    Banned
    You should use some safe data recovery software in order to recover the lost files. I've used the Hetman software solution for such a purpose, and it is one of the best tools for it
    {{ DiscussionBoard.errors[10516643].message }}
  • Profile picture of the author nuliknol
    Originally Posted by Lobsang View Post

    Hello, So I accidentally deleted mysql database of my wordpress, but My site is still running, I can access all the file in the filezilla but I just can't access the admin area of wordpress to make any changes.

    I did made a back up few months ago, I don't want to back up the whole site from the older version because I have much less content on my back up . Is it possible to copy ONLY the mysql data from the old version of wordpress?

    So how can I recover my database without losing any content. thanks.
    how did you do the "delete" exactly ???
    On Linux, if a file is opened by a process, it keeps being opened no mater what happens outside. So, if you delete an opened file, you won't see it at the filesytem level, but the process that had opened it before, will see it, until it closes the file. So, if this is the case , you can connect to MySQL from ssh and do something like
    select * from [put the table name here] into outfile "/tmp/table name here";
    and you will get all the data.
    But if you restart MySQL you will lose everything.
    This is the design of Linux OS. A file that is opened, doesn't gets deleted until all the other processes close it with close() sytem call.

    You ask, how can you restore the database? Depends if you have transaction log stored. If your tables are MyISAM or InnoDB. InnoDB has tgransaction log, MyISAM doesn't . Maybe you can restore last records from transaction log, but you are talking about low level stuff here, difficult for a non-programmer guy.
    {{ DiscussionBoard.errors[10519692].message }}

Trending Topics