weblog of rommel talavera pascual

Restoring WP Database in an Offsite

Did I say – “I don’t know what I enjoy most – blogging or learning all about WordPress” ?

Well, keeping in line with my original objective why I set this blog in the first place, I spent some time learning how to restore a WP database in another site. In this case, on my Ubuntu Gutsy (7.10) at home. I’ve set the main blog site to backup every week and email the compressed backup file. Note however, that this is not a complete backup but rather just all the text found in the site. Any uploaded images/attachments are not included in this backup.

Here are my findings:

  1. Upon restore, viewing the test site will attempt to redirect to the original site. The reason being that the site setup are also contained in the database that was restored.
  2. You should login as admin by going directly to the login page e.g. https://localhost/subdir/wp-login.php then go directly to the Options tab and change the URLs accordingly.
  3. Then go to the Permalinks tab and rebuild it. Unfortunately for me, the URL re-write of my Apache installation was not working, so I set this to the default, effectively disabling Permalink in the test site. This means that posts are access with the odd series of ? and # e.g. https://localhost/?p=123#comments.

That’s it. Even if you do not know how to restore a WP Database – you should still take a backup and keep it somewhere other than your site. Someone can always help you restore it on another site when needed. To be totally safe – keep a backup of your /wp-content directory as well.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Archives

Categories