Docs Advanced Backups & Disaster Recovery

Backups & Disaster Recovery

What to Back Up

A complete backup of your Traffic Exchange Script installation requires three things:

What Where Why
Database MySQL database All member data, transactions, site submissions, settings
.env file /.env in your script root All credentials and configuration — cannot be regenerated
Uploaded files storage/app/ Member avatars, ad images, exported files

You do not need to back up the script files themselves (PHP, JS, CSS) — those can be restored from your original download. Focus on the database, .env, and storage/app/.


Database Backup

cPanel (Shared Hosting)

Option 1 — cPanel Backup Wizard 1. Log into cPanel → Backup Wizard. 2. Click Back UpMySQL Databases. 3. Click the database name to download a .sql.gz file. 4. Store this file off-server (local drive, cloud storage).

Option 2 — phpMyAdmin 1. Log into cPanel → phpMyAdmin. 2. Select your Traffic Exchange Script database from the left panel. 3. Click ExportQuickGo. 4. This downloads a .sql file. Compress it for storage.

Option 3 — SSH (if available)

mysqldump -u DB_USERNAME -p DB_DATABASE > backup-$(date +%Y%m%d).sql

Replace DB_USERNAME and DB_DATABASE with your actual values from .env.

VPS

mysqldump -u DB_USERNAME -p DB_DATABASE | gzip > /path/to/backups/db-$(date +%Y%m%d).sql.gz

Store the backup file outside your web root — ideally on a different server or cloud storage (S3, Backblaze, etc.).


File Backup

.env File

Copy /.env to a secure location outside your server. This file contains database credentials, payment gateway keys, and your license key. Losing it means manually reconstructing all configuration.

Do not store .env backups in a web-accessible directory.

storage/app/ Directory

This directory contains all user-uploaded content. Back it up with your database on the same schedule.

cPanel: Use the cPanel File Manager to compress the storage/app/ directory and download the archive, or use FTP to pull it to a local machine.

VPS:

tar -czf storage-app-$(date +%Y%m%d).tar.gz /path/to/script/storage/app/

Backup Frequency

Site Activity Recommended Frequency
Pre-launch / testing Weekly (or before each major change)
Small site (< 500 members) Daily database, weekly files
Active site (500–5,000 members) Daily database and files
Large site (5,000+ members) Multiple times per day (database), daily files

Set up automated cron jobs or your hosting control panel’s backup scheduling to run these automatically.


Storing Backups Safely

  • Keep at least 7 days of daily backups — this gives you a window to catch data corruption that is not immediately obvious.
  • Store backups off-server — a server failure will take your on-server backups with it. Use external cloud storage (S3, Backblaze B2, Google Drive, Dropbox) or download backups to a local machine.
  • Test your backups — periodically restore a backup to a test environment to confirm it works before you ever need it in an emergency.

Restoring from Backup

Restore the Database

cPanel / phpMyAdmin: 1. Create a new empty database (or empty the existing one). 2. In phpMyAdmin, select the database → Import → choose your .sql file → Go.

SSH / VPS:

mysql -u DB_USERNAME -p DB_DATABASE < backup-20260101.sql

Restore .env

Copy your backed-up .env file back to the script root and overwrite the current one.

Restore storage/app/

Extract your backup archive into storage/app/, overwriting the current contents.

After restoring, clear the application cache:

php artisan config:clear
php artisan cache:clear

A backup you never made is a backup you cannot restore from. Set up automated backups before your site goes live.

Traffic Exchange Script admin general settings with database configuration
Your database connection details are in General Settings — use these to connect your backup tool to the correct database.

Screenshots

Traffic Exchange Script general settings — site configuration, email, and environment options
General Settings — includes database connection and storage paths critical for backup configuration.
Traffic Exchange Script admin audit log — complete activity history for admin actions
The Audit Log gives you a chronological record of all changes — useful for assessing what changed before an incident.
Previous REST API Reference Next Installation Guide