Neat WordPress Restore Technique
I have a WordPress blog. I've had a need to do a backup of my blog content from the mySQL database and then do a restore back into the database after making some changes to the backup copy of the content (my reasons for doing these changes outside of the WP admin screens are a long story that I won't go into).
Ideally what I wanted to do was restore into a differently named database and then after the restore was done, rename my original database to something else and rename the new one to the original name. This way I could keep the original database around just in case the restored content ended up having a problem. If a problem occurred, I could just rename the old one back to the original name.
Unfortunately I found that there is no easy way to rename a database.
But I came up with an alternative. I write SQL commands to rename all of the tables in my WordPress database by prepending the string "old_" to the table names. Then, I restore my backup (which uses the original table names). If a problem occurs, I can just use SQL commands to delete the newly restored table names and then rename the "old_" ones back to the original names.
It's quick and it works great.
-
floatingatoll -
Thanks - 1 reply
{{ DiscussionBoard.errors[281799].message }}-
faverr -
Thanks
{{ DiscussionBoard.errors[282039].message }} -
-