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.

Warning: Never skip this step, especially for major version updates. Without a backup, data loss is irreversible.

What to back up

A complete backup includes two parts:

  1. Database: All your content, settings, users, and application data.
  2. 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)

  1. Log into your hosting panel (cPanel, Plesk, etc.).
  2. Open phpMyAdmin.
  3. Select your Larapen database from the left sidebar.
  4. Click the Export tab.
  5. Choose Quick export with format SQL.
  6. Click Go to download the .sql file.
  7. 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)

  1. Open your hosting panel's File Manager.
  2. Navigate to your Larapen installation directory (e.g., public_html/).
  3. Select all files and folders.
  4. Click Compress and create a ZIP archive.
  5. 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.).
Tip: Keep backups for at least the last 3 updates. This gives you multiple restore points if needed.

How to restore from a backup

If you need to roll back after a failed update:

  1. 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
  2. Restore the files: Delete the current installation files and extract your backup archive in their place.
  3. Clear your browser cache and verify the website is back to its previous state.

Was this article helpful?

Thank you for your feedback!

Still need help? Create a support ticket

Create a Ticket