It only took me nearly 3 years, but finally I've reconciled all the differences between our code repository, the test server, and the live server.
The differing codebases have been a constant pain in the ass for me since I took over development in December 2018. We had our git repository where, theoretically, all the official atWar code should exist. Then we had the live server, which had mostly the same code but also some differences, including some unique code that didn't exist in the repo. And then, finally, we had the test server, which also had different stuff that wasn't in the repo and wasn't on the live server. Sometimes I might be working on a file that was different in all 3 places
When I first looked at this situation I compared each folder and found literally thousands of differences. Ignoring all the user-generated files (like maps, scenarios, user avatars, etc), there still remained approx. 15K code files with differences to solve between the repo, live, and test. Most of them were probably accidental or unintentional changes, but sometimes there was work the original devs had started and just not finished. I didn't want to lose any important work that had already been done, and at that time I didn't know what I could keep and what I could get rid of. So my only choice was to compare each difference one at a time and figure it out.
It was too much to do this all at once, so I embarked on a program of cleaning up as I went. Every time I fixed a bug or made a change somewhere, I would compare all 3 versions of the affected files (repo, live, and test). In this way, I was gradually reconciling the differences over time. The downside of course was the time this took. It is one of (but not the only) reasons why every "little" change on atWar takes longer and is more complicated than it should be.
Another closely related reason why making changes on atWar was a pain was the fact that neither the live nor test servers were under any version control system. The main code repo *was* in git (a popular version control system, for you non-devs) -- the original devs started that in March 2017. However, it was never integrated with the live and test servers -- it just existed in its own separate place. I'm assuming this is because they already knew about the different codebases on live and test, and they couldn't put them into git without potentially losing all those changes, or spending the time to reconcile them.
What was the consequence of this? It meant that every time I wanted to deploy a change to the server, I had to manually compare, then copy & paste files around to multiple places, which took more time and hassle.
Now, all of that is behind us. After whittling away at the problem for nearly 3 years, I finally decided (i.e. I had had enough) that it was time to sit down and tackle whatever was left. So yesterday I started doing this. It took me literally all day, but in the end, I had reconciled every remaining difference. Along the way, I even found some interesting things I had never seen before, which I'll share with you soon. Most importantly, I setup git on the live and test servers, so now everything is connected to the same code repo. When I want to deploy something, it's a couple clicks and I'm done. No more copy & pasting files ever again
(I did the first such deployment to the live site last night, and it was wonderful.... I was so happy...)
Long story short, from now on changes can be made somewhat faster*, deployments will take less time, and I can easily go back if something breaks. These are all things that make me very happy
* I only say "somewhat faster" because there are still other frustrations to be dealt with -- for example I'm still untangling a lot of old, complex, difficult to understand code. The frontend code especially has lots of "logic" code mixed randomly with "view" code, which drives me nuts... whenever I think I'm just making a small visual change to the UI and it ends up breaking functionality in some random other place. There are plenty of other problems too, but that's another story. I'm just glad to have one less problem! Now, back to all the other crap I still have to do here...