We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Recovering entries from backup and merging into current db

How Do I?

wildrock's avatar
wildrock
262 posts
9 years ago
wildrock's avatar wildrock

Ok, first off, I backup my databases diligently, so have needed backups.

Here’s what happened. EE 2.8.1. I have been using login_backup_lite, which works great, until it doesn’t. And it basically shuts down access to the control panel (white screen for PHP error) when the database gets to a certain size (around 16MB or so), as the backup script triggered on login times out and/or runs out of memory. Well, you can only throw so much memory at PHP and adjust time limits, depending on hosting service. So when a white screen happens, the next best thing to do is to optimize the db. And if you’re edgy, you can delete revisions, old unused channels and their data, etc. to minimize the db size.

Except somewhere along the line, a thousand or so entries in an archive section of the website disappears, unnoticed. This, as the big yearly event that pushes the website to the max – and also Structure blows up, and has to be run through its diagnostics to recover its functionality, losing some data that is recovered from backups (and possibly causing the other bibber archive data loss) – we discover that we have a big data hole in the archives.

Which is when I discover all the missing entries. And we’ve added, like another 300 or so new ones in the meantime, so reverting to a previous db version isn’t possible, as the website can’t be taken down, and reentering new data is time prohibitive while all the website users are looking for it.

So now the event is over, things are quiet, and I’ve got the current db, which is in good order (and I will swap out login_backup_lite for a bash script like automysqlbackup to avoid PHP-based add-on backup problems in the future), and the backed up db from right after all the archive data was entered. These entries pretty much were all entered in one fell swoop–like a thousand entries or so, so they’re bunched up in the channel_data table.

What I want to know, is can I copy the channel_data entries out of the backup db export text file and paste them into the current db’s exported text file? Not live of course, I can do this on my dev machine using MAMP to preview the success/failure. If I can go this route, do I need to paste in all the associated channel_titles entries too? Any other entries?

Or is their a better way to export out all the data out of the backup and reimport it into the current db? I can get both versions running in MAMP on the dev, and export the dbs, copy/paste, and reimport and test.

Just thought I’d run this by some folks to see if there is any experience doing this sort of data recovery before I just plow into it and invest a bunch of time that may not be productive. Or does anybody have a good alternative?

One alternative is to copy data, entry by entry, from the live backup dev install and create like 1,000+ new entries live for the archives in the current rev. I shudder at the thought of doing this myself.

Yeah, no fun, either way… but at least I have the backup, or the client would be SOL and p’o’d, and I’d be history.

       
Derek Jones's avatar
Derek Jones
7,561 posts
9 years ago
Derek Jones's avatar Derek Jones

That’s a bummer, wildrock, I really feel for you there. You could certainly cobble things back together with SQL exports and insert modifications, but as you are aware that’s very tedious. If the entries that were deleted were deleted properly (i.e. via the control panel), then one way certainly would be to install an old backup that still had the data onto a temporary environment, create some export templates for the data to be re-used with DataGrab to go back into the live install.

And I guess a third option is to try to find an intern for data entry, and re-enter them. :/

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.