A Lesson In Backing Up Your Files

Deadlines are stressful enough, without technology throwing a wrench into the process. Let this story serve as a reminder of why backing up your work is more important than you think.

I design websites for a lot of clients and have learned, through some unfortunate trial and error, that not every client is completely trustworthy. Most are, but there’s always that one that ruins it for everyone. After meeting one of these bad clients and losing hundreds of dollars and hours of time, I’ve learned to hold my work hostage until it’s paid in full. To make a long story short, I build every client website under my Projects subdomain and it is live from the moment I begin working on it. This allows my clients to watch the progress day to day and provide input throughout the entire process. Once the project has been approved, I transfer the files to the client’s hosting package.

In theory, this should be the easiest part of the entire process. “In theory” being the operative words here.

Transferring a WordPress website is touted to be this black and white process that goes a little something like this:

  • Copy website files to your computer.
  • Export .sql database files.
  • Create new database on client’s website and assign a user and permissions to it.
  • Update wp-config to reflect the new database credentials. Save.
  • Import .sql file to the new database.
  • Upload all those website files you saved in Step 1.
  • Log into WP-Admin and update the Site URL and WordPress Address to reflect the client’s website.
  • Sit back and marvel at your genius.

Sometimes I get lucky and the process really is that easy. Those are the days I rush out and buy a lottery ticket. But most times, everything goes sideways after I upload the website files and I have to get creative.

You know what happens when a WordPress transfer goes horribly wrong? You get a Database 500 error and the world ends. Your phone starts ringing, the client is freaking out that you broke their website and you start sweating. I’ve learned to avoid this unpleasant experience by transferring websites at 2am. Normal people aren’t usually awake at that time and I can screw up in peace.

So there I was, hunched over my computer at 2 in the morning, transferring a massive website for a client. Knowing my potential to screw this up (I know what I’m capable of and I’ve come to terms with it), I quickly made a back up of the website before I started to transfer it. Then I started the process.

The database export went smoothly. Moving the files from my website to my computer went smoothly. Creating the new database on the client’s website was a piece of cake, but it always is. That’s the easiest part.

I updated the wp-config file, imported the new database and started transferring the files from my computer to the client’s website. Fifty thousand files later, everything was transferred and I could see the home stretch.

Rookie mistake and I should know better.

I logged into Wp-Admin and was greeted with a most terrifying screen. “Welcome to WordPress. Let’s start setting up your database.”

No. No. No. NO. Something went horribly wrong.

I quickly popped in phpAdmin to confirm that, yes, my database was there. Then I went to wp-config to make sure I didn’t fat finger the credentials. I’ve done that in the past and I’m still impressed at the level of professionalism Tech Support showed when I was panicking over that.

After confirming that my database credentials were typed correctly, I refreshed the page. Now I had a Database 500 error, but I also couldn’t get into WP-Admin. In normal people English, that means I sort of fixed one issue while creating another problem in it’s place.

Rather than mucking around with the code, I went straight to my back up of the website and used those files to override the original files. It was at this point that I was able to get into WP-Admin. Once again, I updated the Site URL and WordPress Address… and then I got my Database 500 error again.

Fortunately, I didn’t lose access to WP-Admin this time around and was able to update the permalinks. I don’t completely understand why permalinks play such a huge role in WordPress websites, but I don’t argue with results when it magically fixes all my problems.

This entire process took many hours longer than it should have, but that backup saved me even more hours of work. Without it, I could have broken the website beyond repair as I was trying to fix the issues I created, and then had to work like a fiend to redo the entire website before the client realized what had happened.

And that’s why a backup is so important. I guess this story could also serve as a reminder that insomnia is sometimes a good thing too. If I was normal, I would have broken a website during business hours and my client would have definitely known something was up.

Leave a Comment

Contact Us

I'm not here right now, but please leave me a message. Beep!

Not readable? Change text. captcha txt