Guide Contents
The Golden Rule
How to Update Depending on How You Got the Files
If the Project Is Linked to Git
cd /var/www/html/WorkUp
git status # Make sure there are no unsaved local changes
git pull origin main
git pull automatically pulls all new changes and merges them into the existing files. If a "conflict" message appears, stop and ask for help before continuing — this means the same file was modified both locally and in the new update.
If You Upload Files Manually (Without Git)
Do not replace the entire folder all at once! Some files must never be touched because they contain your own settings:
includes/config.php (your database credentials) and .htaccess (your server's include_path). Also do not touch the files/ folder (real employee photos and attachments).
Only upload the actual files/folders that changed in the update (whoever sent you the update usually tells you which ones), via FileZilla or scp, explicitly excluding the files above.
Does the Update Require a Database Change?
ensureSchema) — you don't need to run any SQL command manually in most cases. But if the update comes with a file named something like update.sql, or explicit instructions saying "run this query," execute it like this:
Running a Database Update File (Only If Explicitly Instructed)
mysql -u workup_user -p workup < update.sql
Do not run this command "just in case" without a reason — only when you know for certain that a database update file is included with the new version of the code.
A Quick Test After Every Update
Before You Declare "Done," Try This
sudo tail -f /var/log/apache2/error.logapi/ files).Rollback Plan
Rolling Back Depending on the Method Used
With Git: go back to the last point that was working (a previous commit):
git log --oneline -5 # View the last 5 updates and each one's ID
git reset --hard previous_commit_hash
With manual upload: if you kept a copy of the old files before replacing them (it's always best to take a copy before any manual update), re-upload it as it was.
In both cases: if the update touched the database, restore the database backup you took before the update (see the restore guide).