Use Versioning: It Can Save Your Behind

Do you ever change something on your site then realized whatever it is you made completely messed up the design. So you go back to take out the change but the problem still remains. You can’t get your site back to where it was. So frustrating!

Code
Photo credit: Paul Fris

I’m not afraid to admit I’ve been in that place way too often. Thankfully, one of my developers got me in the habit of Versioning. Versioning is act of process labeling or logging each change you make to a file or software. Sounds so difficult and complicated right? It is totally not. Here’s what you do.

 

Before making any change even if you know you’re not going to mess up anything – this by the way is especially helpful when making changes to WordPress themes – make a copy of that file and append the date. For example, I’ll rename the sidebar.php to sidebar-080613.php. Only after I’ve saved this file do I go back to edit sidebar.php.

If anything goes wrong, I can quickly switch back to the old file before changes where made by simply renaming things as follows (yes its like a backup):

  • sidebar.php to sidebar-workinprogress.php
  • sidebar-080613.php to sidebar.php

It only takes  a few seconds. You can continue to find the problem in sidebar-workinprogress.php without visitors seeing the messed up design. Do this for every edit you have.

Aside from that, it also helps to make small comments inside the file noting what was changed. That will really help when you need to troubleshoot in the future.

Do You Want A Hands-Free Business?

Then get this guide to help you systemize your business so you'll have more time working on your business.

!
!

Hey! I want to make sure you know what you're getting here. In addition to the guide, you will also receive our memo that includes special offers, announcements and of course actionable information.

Terms and Conditions checkbox is required.
Something went wrong. Please check your entries and try again.
Facebook Comments

5 Comments

  1. Stephanie Trahd on June 13, 2008 at 10:27 pm

    Interesting idea Lynette!

    I usually do something similar in Notepad. I’ll save the file with the date and the change. For instance, I may call one backup sidebar-61308-Aweber (if I just added my Aweber webform to the sidebar on 6-13-08). Thanks for sharing!



  2. Lynette on June 14, 2008 at 12:58 pm

    @Stephanie: Good for you! It is so much easier. I too originally started with the modifications I made but the filenames became too long and sometimes the changes were complicated. Eventually, I moved all the mods into a log file that is kept outside the publicly accessible folders.



  3. St. Francis Bird Feeders on July 3, 2008 at 5:41 pm

    I’ve done that more often than I care to admit. One other thing that has helped bail me out for those sites I create on the computer is the Time Machine feature on the Mac, which makes an hourly backup. More than once I’ve messed something up only to go back to the old version, which it has kept for me.

    I seem to live by the old saying that I don’t have time to do something right, but I have time to do it over!



  4. Jack on July 6, 2008 at 1:52 pm

    Not sure if you use DreamWeaver – but if you do – is it possible to do this automatically in DW?
    Thanks
    Jack



  5. Lynette on July 8, 2008 at 12:05 pm

    @St. Francis: I need to check that Time Machine feature out. Don’t do a lot of development on the Mac here but it sounds very handy. Love the doing over part. How true.

    @Jack: Not sure. I don’t use Dreamweaver. I’m sure many programs auto-save to your local computer. The reason I do this is, a lot of my theme editing is live – unless it’s adding major functionality. It’s easier that way than trying to keep the ones on my computer and the ones on the server synced up properly. So all the ‘versions’ are stored on the site (space consideration taken into account).