Feb 222010

So yesterday I told you about these evil crawler bots and how they’re able to silently corrupting blog files into oblivion if you don’t catch it soon enough.

Even if you do figure it out quickly, 98% of the time your files are already affected. Even if you remove the “bug” there’s still going to be some issues. Thing is though, unless you’re a programming geek, you’re not going to be able to manually pick out all the little bug poop bits from your files. What you need is a clean version of your blog.

Except….you don’t have it, do you.

No, you likely do not.

Some people that I’ve talked to use a WP plugin that creates an automatic backup of their database and it gets emailed to them. Ok, great. But guess what? It’s not enough.Some of you are gonna be all “WHAT database??? There’s a database??” cause I know I was.

Last week when dealing with SBC.com, we found that out. We also found out that SQL databases are tricky bitches. If you don’t know anything about backing up the database, when you do figure out how to do it manually you’re just going to let the default options go. Except those default options leave extraneous info that is actually bad; it confuses the restore (at least with GoDaddy). The default DB backup included “Create” lines and lines for the “information schema” which are essentially duplicate commands and duplicate commands are NOT friends with SQL. They made the restore attempts spit back errors at me like mad.

Let me back up. First of all, the problems with SBC are not ones that most of you will encounter when needing to rebuild your site. The reason being is that we didn’t have access to the domain files because they were under someone else’s account. The database, so we all thought, contains the posts and the comments and all that good stuff. So that’s all you need, right? A few Godaddy guys lead me to believe that. It’s  not the case. You need a whole shit ton of .php files that are running amok through your WP files. These .php files talk to the database and link everybody up.

There’s two ways to get these .php files.

1. If you have access to the hosting account, you can go into the file manager and copy everything to your hard drive.This is the more complicated way I guess, bc the next option just involves a few clicks and one file, however this method will also backup all your theme files, stylesheets if you’ve tweaked the theme, etc. But there might be an instance when this option is your only option.

2. You can go into the WordPress dashboard and do an Export. ” When you click the button below WordPress will create an XML file for you to save to your computer. This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags. Once you’ve saved the download file, you can use the Import function on another WordPress blog to import this blog.” This option is simple. It saved everything except the tweaks I’d done to the stylesheet.css for the theme (since I had to re-upload the theme) and the contents of the widgets in the sidebar.

For 3 days, I couldn’t do either of these options. The moment Diva was told by GoDaddy that we hadn’t actually truly transferred the blog, they had her change something called the “nameservers”. The nameserver is what tells the site where to find its files. Once the nameserver was changed from pointing at Dreamhost to pointing at Godaddy…..buhbye blog as we knew it. Suddenly we were staring at a blank “baby” blog. No posts, no theme, no nuttin. Some asshat at GD said “well you can just go into the WP dashboard and export” um no, no we can’t, since the dashboard sees the baby blog, too. It’s not like we could go to another http site address and snag the files, that wasn’t the case. When we FINALLY after 37 attempts got the stupid database to restore properly we were gutted to find out that nothing had changed on the blog. But thank you, GoDaddy, for not explicitly telling us what would happen when we changed the nameservers and asking us if we had ALL the files backed up from the WP dashboard.

My final call to GoDaddy was at first hopeless; he informed me that we *needed* all those WP files, the database alone wouldn’t bring back the posts even if I could recreate the theme by myself. Then it occurred to me. Wait a minute. This all went to hell the moment we changed the nameservers. Couldn’t we change them BACK to pointing at Dreamhost, and I could go into the WP Dashboard and export, then change them back to pointing to GD and import? Well…..he’d never done that before, but he supposed I could.

And I could. It took a few hours from the time at which I changed the nameserver values until I was able to go into the WP dashboard and be accessing the correct version/location of the blog. Since I had to do this twice because my first g-round I didn’t realize I had to copy the contents of the widgets, the whole import process took about 24 hours.  And once I imported? *cue angels singing from heaven* The beautiful pretty blog! It was back! Everything was there! We all jumped around and were excited. A few quirks with some photos were fixed and all was well. (this folks, is a shining example of how sometimes my weird ADD odd way of thinking can actually be a help)

So. What’s the moral of this story, kids?

Backing up WordPress is necessary. Backing up the database is not as useful as you’d like to think. Don’t get me wrong, you should do it, but don’t count on it to be your saving grace if all else is lost. If you have nothing but the database, it’s like having cherries and flour and butter and sugar and whatnot but no recipe or equipment to turn it from ingredients to pie.

As I said yesterday, I didn’t have to worry about this backing up with e[lust] because GoDaddy backs up everything (they have a “snapshot” of your files for every day of the last 3 weeks I think). Every file, they have – except for the database, since it’s always in use it can’t be automatically backed up. Because my site was hacked, it wasn’t the posts that I needed to restore, it was the php files.

If You Have a Self-Hosted WordPress Blog (and you don’t have Godaddy as a host)

1. Like your theme? Have you made changes to the stylesheet at all? (if not you, then someone else?) Then you need to back up the stylesheet/phps because the WP export won’t do it all. When I imported the WP dashboard export, the theme didn’t follow along. And of course, you know me, I had made changes to the theme from the original.  Luckily though I had also manually copied the contents of the css and the php files from the theme editor over to text files. Some copy/pasting and we were visually pretty again.

2. As often as you can think to do it, manually perform the WP export from the dashboard. I tried looking for WP plugins that will automatically do this but there were either complicated as fuck or not compatible with the recent upgraded version of WP. Extra precautions would tell you to save these XML files someplace other than your harddrive, because you never know when that could die.**This export backup won’t save your sidebar/widget contents. If you’ve got a lot of text boxes filled with banners and links and fun stuff in the sidebar, you should do a copy/paste as I instructed for the theme files**

3. Add the plugin called “WP – DB – Backup”. Go to “Plugins” then “Add New” and then search for that one and click on “install”. Then activate and go to “Tools”, “Backup” to check off all the boxes (I left the “exclude post revisions” unchecked because who knows, I might need that) and tell it to email you the backup zip file. (don’t forget to schedule daily or weekly backups, depending on how often you put up a new post).

Now then, why am I telling you to do step 3 if step 2 saves the posts/comments that the DB saves but can’t “read” without the php files? Because at least step 3 is automatic and daily. Step 2 relies upon you remembering to do it. Even if your last WP backup was a month ago, you could still import that database backup and then go to your hosting provider (PHPMyAdmin control panel or similar) and restore yesterday’s DB, bringing your recent posts and comments back.

If You Have a Self-Hosted WordPress Blog (and you DO have GoDaddy as a host)

1. Like your theme? Have you made changes to the stylesheet at all? (if not you, then someone else?) Then you need to back up the stylesheet/phps because the WP export won’t do it all. When I imported the WP dashboard export, the theme didn’t follow along. And of course, you know me, I had made changes to the theme from the original.  Luckily though I had also manually copied the contents of the css and the php files from the theme editor over to text files. Some copy/pasting and we were visually pretty again.

3. Add the plugin called “WP – DB – Backup”. Go to “Plugins” then “Add New” and then search for that one and click on “install”. Then activate and go to “Tools”, “Backup” to check off all the boxes (I left the “exclude post revisions” unchecked because who knows, I might need that) and tell it to email you the backup zip file. (don’t forget to schedule daily or weekly backups, depending on how often you put up a new post).

Don’t worry about Step 2 unless you foresee yourself changing to another host. GD’s file snapshots will be there for you, ready to roll back to if something happens. You don’t have to pay extra for it, you don’t have to ask GD to do it for you. If you need to roll back, you log into your account, go to the hosting control panel and go to the File Manager. There’s two tabs there on the left. Current and History. If you were to click History you can see the files, and only one button is highlighted….”restore”. You’d just check off all the folders/files you need to have restored, and then click restore, and the roll back is complete. The only portion I’d recommend backing up on your own are the widgets, I don’t believe that there is any file in your directories that have the info of whats contained in the widgets. I need confirmation on this.

If You Have a WordPress Hosted Blog (i.e. http://yournamehere.wordpress.com)

You have one option. You do a WordPress Export via your dashboard as often as you can think of it. You can’t use plug-ins, and there’s no database to access. I read somewhere while searching for all this info that doing this Export won’t save your photos. But it did. When you go to Import, and you re-map the users (if you need to) there’s a section that says Import File Attachments and you have to check off that box. Voila, your photos appear.Again though your blogroll and sidebar widget contents aren’t saved in this. Manually copy them to a text file.

Understanding your Self-Hosted WordPress Blog’s Host Control Panel

Let’s say you have a self-hosted WP blog and you didn’t set things up yourself, you had help from a friend or fellow blogger. I don’t care who they are, you need to be able to rely on yourself to fix things should it all go to hell. You never know if one day you stop speaking to this person or they just simply aren’t available immediately to help you fix it. You need to learn how it works at the core level, which can be more complicated. But in the end, it’s worth it to be able to rely on yourself for bringing it all back up to speed. I know that there are companies now like Discreet Press who are taking advantage of the blogger who doesn’t want to have to deal with this stuff by charging a lot more than I’d ever pay by offering more than just hosting. They can do design, they can repair your site, etc. However in my opinion most of us bloggers can only afford the least expensive hosting plans. Which Godaddy DOES offer. And for the services they give you in comparison to other plain hosts (like Midphase) it’s a damn good deal. I don’t care how technically inept you might think you are right now you CAN learn the basic shit. I did. So many times over the last week and even just while writing this post I had these Algebra Class moments. I can’t tell you how many times I was able to come up with the right answer but got points knocked off because I couldn’t show my work. Don’t know how I got there, or I couldn’t explain how I got there, but I did and that wasn’t good enough for the math teachers. Anywho. If you’re financially stable enough to willingly hand over full control and reliance over to a company, then go for it I guess. In the end though I don’t care how stressful this all was, I didn’t like having to rely on others and would have taken on more stress if I could have just done it all myself. I hated having to ask Alec a million times for help. I hated having to wait for someone else to have the time to help me; I wasn’t paying them, I couldn’t just say DO IT NOW!!

What could happen to precipitate this need for self-preservation, in addition to the hacking I talked about yesterday?

Simple. You installed a WP plugin that wasn’t compatible. Shit, I just did it yesterday when searching for automatic full backup plugins and the like. One of them made site visitors see some wonky ass code after they commented. A second one rendered my WP dashboard completely fucking useless. I had to go into the GoDaddy hosting control panel to the File Manager or their java-based on-site FTP client and remove the plugins manually. That meant going to wp-content folder, plugin folder, and deleting the whole folder of the plugin I just installed. Like magic, my dashboard/site were working fine again. If you don’t know how to do this, your site will sit there all sad and broken for awhile while you panic and stress and maybe even cry as you wring your hands and wait for help to come, and you don’t want that. But you also have to understand those files which you CANNOT just delete, otherwise, you’ll render your blog sad and broken all over again.

A Final Word on GoDaddy

You’ll notice, if you actually managed to read the whole post, that sometimes the GoDaddy tech support people I had to call weren’t giving me 100% perfect information/instructions. Every tech support person there knows their basic GoDaddyWorld facts; some know more personally about how WP blogs work and how databases work. Some are better able to explain techy stuff to a clueless moron such as I was, and some left me more confused. Some fixed one little part of the database restore problem but not all of it (bc GD doesn’t support our database health in transferring from another host and restoring, database programmers are paid big bucks to understand the coding of it). Even though GD could have saved us 3 days of stress & anxiety by giving us the correct help and answers……you’re going to encounter that anytime you have to call any tech support. This doesn’t negate the fact that I still will fully recommend GoDaddy for what they provide to you at the cost they provide it at.

So, please, if you’ve ever gone through backing up, moving blogs, fixing blogs, restoring databases, managing your files thru the hosting control panel and can give information that I got wrong or didn’t list, tell me about it in comments!

Some links to help you further:

How to export the database from PHPMyAdmin: http://codex.wordpress.org/Backing_Up_Your_Database

Some screencaps to illustrate further:

  7 Responses to “Contingency Plan: Part 2”

  1. Wow I must say the time and expertise you put into this is extraordinary DL….

  2. It’s probably because I am experienced with moving hosts and I’ve backed up WordPress numerous times that I find this post to be a little less helpful than it could be.

    Your issue with nameservers was more difficult than it should have been and I am shocked GoDaddy wasn’t more help. Even though you could not access your dashboard (for the old hosting) via domain.com or whatever, there is always a URL where your site can be accessed at all times. For me it’s a a subdomain of my host’s domain like “tempurl123.myhost.com” which allows me to see my site and, of course, I can log into WordPress from there to export from my dashboard. I probably wouldn’t do that, though.

    ~Actually our issue with the nameservers was only difficult simply because it was the ONLY way to go back to the “old” blog’s WP dashboard. Most other people will not have to do that. I did explain that. Also, I wouldn’t assume that everybody’s hosting has whatever subdomain you mentioned. I know that Dreamhost didn’t. Plain and simple. Messing with the nameservers was the. only. way. ~

    I do use a plugin which has my database e-mailed to me and if I had to switch hosts or redo my database, I would start with a fresh, empty database and import the SQL files with phpmyadmin (and there are plenty of tutorials about how to do this). Then, I would only need to mess with the config.php file to really set it up. The only files I would actually save are the index.php and my theme and plugin folders.

    ~Most bloggers are not going to be able to or even want to go through that hell if they just do a WP dashboard backup every once in a while, and backup their theme once after they’ve tweaked the CSS~

    It may sound like I am really comfortable with MySQL/databased but the truth is, I know very little. Importing and exporting are just about the easiest things you can do and if your hosting account allows you to use PHPMyAdmin and you can google “how to import with PHPMYAdmin,” you can do it.

    Let me clarify something here. There are very FEW php files you need to move or restore your blog. Pretty much everything except for the wp-content folder and the config.php (and -maybe- the index.php) in the main directory is generic and can be reinstalled from scratch. Had you known this, and had you known how to import your database (assuming you had a copy), then you would have needed to download very little and would not have had to worry about downloading every PHP file (especially when some of them may have contained malicious lines from these bots). All you need to do is make sure that the database user, password and table name in PHPMyAdmin matches that in your config.php file – otherwise, your blog will be blank.

    ~Clarify all you want – but I did know *exactly* what to do with the config.php file and I did. I stared and stared at it, making sure that every line matched up with the database contents and it did. And yet somehow I was still left with an empty blog. Hence the nameserver bullshit.~

    While it’s true that I would have a very bland blog without my physical theme files, I would much rather ONLY have my posts, pages, users, comments and settings from the DB than to only have my theme and a blank blog. The information stored in the DB is really the “meat and potatoes” of the blog. With a clean install of WordPress, you can have all of that content and only have to edit the config.php (so, actually, if you know this then you don’t have to save it from your old host/installation) which is exactly why backing up your DB is your saving grace.

    What you have said here paints a very bleak picture of GoDaddy. They gave you a lot of half-assed information and I completely understand that it is not their job to know WordPress inside out but they should have at least told you that there should be a way to access your old host without having to switch the nameservers back. I can see that you’re still confused (and the result is a confusing post) so I hope this comment helps you and others who may run into similar problems.

    ~ Again, it doesn’t speak well of *some* of the tech support agents I encountered at GD. As I said, I would not take that against the company as a whole. It will not prevent me from fully recommending them to others. But again, their job is to understand the domain and hosting and such. Not to understand how other hosting companies work or database coding. Not many people understand sql coding enough to have known why our database restores kept failing. I’m sorry you personally found my post confusing. Well, no, I’m not. You could have given your experiences without criticizing what or how I wrote. But then again, you do tend to be abrasive.~

  3. Also, I’d like to say that knowing how to access your files, whether via a file manager in your hosting control panel or via FTP is something everyone should know.

    I apologize for sounding bitchy but I am just frustrated that you were in that position at all.

    ~ Actually, yes, you DO sound bitchy. Helpful information is welcomed, but to start out with telling me how UNhelpful my post is, that I didn’t have to write up but did so over the course of two days? I haven’t even read all of your comment because it’s hard to follow what you’ve said, I’ll address whatever you’ve said tomorrow morning.

  4. I didn’t tell you this (at least, I don’t think so), but I got hubmanshangout.com just days before all this shit happened to you and the others. Immediately I thought “great, now I’m fucked” but thanks to this pair of OUTSTANDING posts, I feel much better about self hosting.

    You rock!

  5. Welcome to the wonderful world of web design ;) I deal with all of this stuff on a daily basis hehe. Hence I hate coding. When someone says build me a website, they normally have ‘nooo’ idea whats involved ;)

  6. I’ve backed up my widgets just to be on the safe side. I think what you’ve been doing is amazing. The techies would have had me in tear of frustrated rage because they speak a foreign language.

  7. I don’t know about you, but I’m so f#!*ing frustrated trying to figure out how to use the SQL! All I want to do is set up a password protected page, but while I’ve set up the database, I’ve been unable to get the rest of the info aligned … KCUF!

Sorry, the comment form is closed at this time.