• Have WordPress on a server at home. I had it on a 256GB USB flash drive and when I rebooted it could not mount it. I fixed the fstab so it don’t mount it and ran a fixdisk type command in Ubuntu running. But it just made a lost+found with a lot of blank files in it looks like.

    I had a 2 month old backup and dumb me I restored that Database too but I forgot the Database was stored on the eMMC of the server so the restore messed it up!

    Used a program to get deleted files back and did a search for the last text I know I had in there and found it in a file but it had a lot of junk before it and after. I deleted that part and have a part that looks like it’s a /var/lib/mysql/WordPress/wp_post.MYD

    So I added that in the last part of the wp_post.MYD and restarted mysql but it don’t show it in WordPress or even in phpmyadmin. The last post still the 2 months ago.

    The only thing looks like I could do and copy and past each day but it’s hard to know the time and day in that wp_post.MYD file because I guess they are hex for that data.

    Any one know how I can get this 2 months back. I posted every day in it.

    -Raymond Day

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Backing up the files in /var/lib/mysql is not the way to make backups of MySQL content. Use mysqldump for that. This is my script: https://gist.github.com/sterndata/99ac86682a2d6529fab06abec5e43949

    If you also have the .FRM file, you may be able to recover:
    https://stackoverflow.com/questions/879176/how-to-recover-mysql-database-from-myd-myi-frm-files

    Thread Starter RaymondDay

    (@raymondday)

    The .RRM file only “The .FRM file has your table structure in it” that’s what I got from the 2nd link you gave.

    My WordPress on my cell phone had 7 days on it and I copied and past them in put them in tags “restred from cell phone”

    I guess I will have to match the some days up with text and keep track of it from there. In the restore file from deleted files that looks like it’s the part I am missing in the wp_post.MYD file. I guess that’s the only way and can’t get the time just right but the days should be right and it will take a long time doing it by hand.

    Right now. I guess because I added more post from my cell phone and put the recovered from deleted file right at the last part of the database the wp_post.MYD file. I can see all the post but it just says on the main page now 4 pages! About, Forum, and 2 Sample Pages.

    Going to have to try and fix that taking that part back out.

    Thread Starter RaymondDay

    (@raymondday)

    Restore some by hand. He to restore the Database again from the last backup about 2 months ago.

    Put the Data back in from my cell phone about 7 days but skips days too.

    Looked at the file recovered from deleted files. It’s long but only has one post I did not have at the end of it. Because it repeats over and over with more added on each time. I guess each revision.

    Don’t know but there could be more files like that that got un-deleted. It be very hard to hand get the text out of them.

    The last backup I got was from a script I was working on. If only I set up a cron job would of had a backup. I just had the backup of the testing it from 2 months ago.

    It seems to work good if any one wants it it looks like this:

    #!/bin/bash
    
    #Variables
    name_base=<code>date +&quot;%Y-%m-%d_%H:%M:%S&quot;</code> #defind name base for archive off of date
    backupdir="/media/500GB/WordPress_Backup/OnlyBackUp/"
    contentdir="/media/512GB-WordPress/wordpress/wp-content/uploads/"
    
    #Start backup
    
    tar cvf $backupdir/WordPress_Data-$name_base.tar $contentdir
    
    mysqldump -u root --password=XXXXX --databases WordPress > $backupdir/WordPress_Data-$name_base.sql
    
    #Create tar file
    
    #Add mysql dump to archive
    tar -rvf $backupdir/WordPress_Data-$name_base.tar $backupdir/WordPress_Data-$name_base.sql
    
    #Cleanup
    rm $backupdir/WordPress_Data-$name_base.sql
    
    #delete backups over 7 days old
    
    find $backupdir -mtime +7 -type f -delete

    I X’s out my database password.

    That’s how I restored the data back from 2 months ago.

    It makes a big tar file my is named this:

    WordPress_Data-2017-03-11_11:18:38.tar

    That’s the one I used to restore it. but like I said about 2 months of last data.

    -Raymond Day

    • This reply was modified 7 years, 6 months ago by RaymondDay.
    Thread Starter RaymondDay

    (@raymondday)

    Wow I open my Chrome netbook and I had it on my WordPress and it keep poping up for me to log in but Wow I could see titles on it for about the last month and I typed them all in to restore them.

    Here is a screen shot I did of one of 4 pages that I got back like this.

    This is my WordPress I am running at home on a Intel Compute Stick:STK2MV64CC it’s running on Solar power.

    Happy at lest I got a lot of titles back. Maybe I can do a find for the recover deleted files and it my find that day.

    Hope some time can restore it easy. I did do a DD back up of the Intel Compute stick before I started to add to my WordPress. So it my be in there. Not sure.

    To restore the Database with the 2 month old one I used Webmin. If I did not all that Date base would be there because it on the flash RAM in the Intel computer stick.

    -Raymond Day

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Lost about 2 months of DataBase’ is closed to new replies.