Updating a website you didn't code

I wasn’t sure which category to put this in. Apologies if it’s in the wrong section.

Anyway, lately I’ve had to work on a bunch of different websites I didn’t originally build.

I always feel uneasy about jumping in and modifying / updating code without much thought. What’s a better way to approach this? I’m thinking of creating a seperate CSS file (such as update.css) with a commented section explaining what I updated and when as a form of version control. It’s a bit harder for HTML, but I could still list the modifications in a separate file. That seems like a bit of a time waster though.

Or I could get a local version of the site running and set-up my own version control from there. Could be a bit of an overkill for smaller jobs?

Am I overthinking this, or does anyone have a smart way to update an unfamiliar build which can easily be reverted back if problems occur?

1 Like

That’s a really good question, one that I’ve encountered from time to time, and I don’t know that there is one right answer.

As for me, I deal with this fairly frequently and I eventually settled on creating a generic repository using GIT (was using SVN for the longest time). I think it is named “ClientSites”, and when I get a one-off like you’ve mentioned, I download their site as a folder into that repository.

Then I can track all of the changes I made and I know which files to push back to their website. If the client comes back and asks why my changes aren’t working anymore, I also now have a way to compare what I did to what they currently have on their site.

To me, it is worth the extra cost of getting it setup locally, as it usually helps me to troubleshoot things later on, should questions/problems come up.

4 Likes

I think @cpradio is spot on there. If you aren’t interested in setting up version control, simply zipping an “original” of their site (and any database exports) can be worth it by far in the long run, if you need it. A new, “last called” CSS file that could overwrite some of theirs isn’t terrible, although it might end up being a lot of hassle.

In the end if there’s any chance that you’ll need to be rolling back parts or all of your changes… I’d go with version control, even if it’s a bit more tedious. Even if you don’t deploy with it, at least it’d be there locally.

I agree with the other two replies. I also think that a version control (or source repository) system can be an enormous help in this situation. There are many such systems available. The one I use is called NG3; it’s a big professional system, and is probably too expensive for a solo developer - I only use it because my biggest client had standardised on it. I can’t imagine working on a large team-based product without this system - or something similar.

You mentioned commenting. This is defintely worth doing. But with a good version control system, you don’t need to add comments within the code, as you can also add comments at the file level. In other words, the comments are stored in the version control database, where they are visible to other team-members, but do not form part of the files that you actually deploy. You might still want to add comments within the files to document individual changes. That’s fine. But consider developing a routine for removing them when you deploy the files (I’m thinking particularly of HTML, CSS and JS files), because you won’t want the general public to see them.

Good luck with the project. You are clearly thinking along the right lines.

Mike

These are fantastic replies, thank you for your responses! I’m comfortable using version control, for all fresh builds I use a combination of BitBucket, Tower and dploy.io which works well for me.

I think as you’ve all suggested, the extra effort to grab a copy of the site and set-up a local version would be worthwhile in the long run. I’m always just a bit hesitant to do so on smaller jobs, but I should just suck it up and get it done.

Appreciate your thoughts everyone.

1 Like

Maybe the best way is really to use comments. They are supported in every language and in CSS. You can forget something and easy notification is to write comments. How about that?