[GTALUG] Selectively restoring WordPress posts from old SQL dump

Bob Jonkman bjonkman at sobac.com
Thu Mar 30 16:52:03 EDT 2017


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would:
1) restore from a known good backup into a temporary DB and create a
new WordPress instance for your target blog
2) replace the November posts, pages, comments and media files in the
temporary instance with ones from the current instance (and also any
posts, pages, comments and media added since the backup was taken)
3) swap the temporary instance for the current instance.

That'll give you an independent blog with a separate database, leaving
the others in the one database. That database will still contain the
table with the corrupt data, but nothing will be using that.



You may want to consider splitting your one database into multiples
for the other blogs too. Each table name in the database should have a
prefix that identifies the blog it belongs to. Make a .sql text-only
backup, then you can split the single .sql file into individual .sql
files based on table name prefixes, fix up the headers so they're a
valid .sql files for importing, then use them to create individual DBs
for each blog.

- --Bob.

On 2017-03-29 11:24 PM, William Witteman via talk wrote:
> I have a bunch of WordPress blogs sharing a database, which seemed 
> like a good idea at the time.
> 
> Now I have a bunch of posts that were overwritten at *some* time
> in the past by bad data, but my backups are good.
> 
> My backup testing works perfectly well for complete replacement,
> but I don't want to do that - I want to cherry-pick for one blog of
> several, and only replace posts that existed in November with the
> same IDs in today's database, but leave everything else alone.
> 
> Does anyone have any thoughts?
> 
> Right now I am hoping not to have a couple of terminals open and
> try to manually run UPDATEs with copy-n-paste, because that seems
> rather error-prone.
> 
> Thanks!
> 
> William --- Talk Mailing List talk at gtalug.org 
> https://gtalug.org/mailman/listinfo/talk
> 

- -- 


Bob Jonkman <bjonkman at sobac.com>          Phone: +1-519-635-9413
SOBAC Microcomputer Services             http://sobac.com/sobac/
Software   ---   Office & Business Automation   ---   Consulting
GnuPG Fngrprnt:04F7 742B 8F54 C40A E115 26C2 B912 89B0 D2CC E5EA

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Ensure confidentiality, authenticity, non-repudiability

iEYEARECAAYFAljdb+YACgkQuRKJsNLM5eo0cgCgis4Cc6MVLBWXiW0iKQL9MfLT
2SMAoMQsItuJwiVDLIqUzYxAmk6kCW4k
=dcEo
-----END PGP SIGNATURE-----


More information about the talk mailing list