Updating

Keep your Timecrack installation up to date by pulling the latest changes from GitHub and running a few commands.

Before You Update

Always back up your database and .env file before performing an update:

mysqldump -u your_db_user -p timecrack > timecrack_backup.sql
cp .env .env.backup

Important: Never skip the backup step. If something goes wrong during the update, you can restore your database and configuration from these backups.

Update Steps

From your Timecrack installation directory, run the following commands:

  1. Pull the latest changes from GitHub:
    git pull origin main
  2. Install any new or updated PHP dependencies:
    composer install
  3. Run database migrations to apply schema changes:
    php artisan migrate
  4. Clear application caches:
    php artisan cache:clear && php artisan config:clear

Tip: If you have compiled front-end assets, you may also need to run npm install && npm run build to update them.

Checking Your Current Version

You can check your current Timecrack version by running php artisan --version from the command line, or by checking the latest commit with git log -1.

Troubleshooting Updates

If you encounter issues after updating:

  • Check the Laravel log at storage/logs/laravel.log for error details
  • Ensure file permissions are correct (the storage and bootstrap/cache directories must be writable)
  • Try clearing all caches: php artisan optimize:clear
  • If migrations fail, restore your database backup and check the release notes for version-specific instructions