Why backups are essential
Larapen's update system is upgrade-only: there is no built-in rollback mechanism. If something goes wrong during an update, your only recovery option is to restore from a backup. Always create a full backup before every update.
What to back up
A complete backup includes two parts:
- Database: All your content, settings, users, and application data.
- Files: Your entire Larapen installation directory, including uploaded media, configuration files, and any custom modifications.
Step 1: Back up your database
Using phpMyAdmin (cPanel / hosting panel)
- Log into your hosting panel (cPanel, Plesk, etc.).
- Open phpMyAdmin.
- Select your Larapen database from the left sidebar.
- Click the Export tab.
- Choose Quick export with format SQL.
- Click Go to download the
.sqlfile. - Store this file in a safe location outside your server.
Using the command line (SSH access)
mysqldump -u YOUR_DB_USER -p YOUR_DB_NAME > backup_YYYY-MM-DD.sql
Replace YOUR_DB_USER and YOUR_DB_NAME with your actual credentials. You will be prompted for the password.
Step 2: Back up your files
Using a file manager (cPanel / hosting panel)
- Open your hosting panel's File Manager.
- Navigate to your Larapen installation directory (e.g.,
public_html/). - Select all files and folders.
- Click Compress and create a ZIP archive.
- Download the archive to your local computer.
Using the command line (SSH access)
cd /path/to/your/website
tar -czf ../larapen-backup-YYYY-MM-DD.tar.gz .
Step 3: Verify your backup
- Open the downloaded SQL file in a text editor; verify it contains your tables and data.
- Check that the file archive is not corrupted by listing its contents.
- Store both backup files in a secure, off-server location (local computer, cloud storage, etc.).
How to restore from a backup
If you need to roll back after a failed update:
- Restore the database: Import the SQL backup file via phpMyAdmin (Import tab) or via the command line:
mysql -u YOUR_DB_USER -p YOUR_DB_NAME < backup_YYYY-MM-DD.sql - Restore the files: Delete the current installation files and extract your backup archive in their place.
- Clear your browser cache and verify the website is back to its previous state.