Skip to content

PulseLMS Backup and Restore Guide

Overview

PulseLMS provides comprehensive backup and restore capabilities to protect your course content, user data, and learning activities. This guide covers all aspects of backup and restore operations, from individual course backups to site-wide data protection strategies.

Backups are essential for: - Data Protection: Safeguarding against accidental deletion or corruption - Course Replication: Creating copies of courses for new terms or sections - Migration: Moving courses between PulseLMS instances - Archival: Preserving completed courses for reference - Disaster Recovery: Restoring operations after system failures


1. Course Backup - What's Included

1.1 Understanding Backup Content

When you create a course backup in PulseLMS, the system packages various course components into a single compressed file (.mbz format). Understanding what's included helps you make informed backup decisions.

Core Course Elements

Component Description Backup Behavior
Course Settings General course configuration, format, appearance Always included
Sections Topic/week structure and descriptions Always included
Activities All activity modules (assignments, quizzes, forums, etc.) Configurable
Resources Files, folders, pages, URLs, labels Configurable
Blocks Sidebar blocks and their configurations Configurable
Course Files Uploaded files in course file areas Included with activities
Completion Settings Activity and course completion rules Configurable
Competencies Linked competencies and frameworks Configurable

User Data Components

Component Description Default State
User Enrollments Who is enrolled and their roles Excluded by default
Activity Completion Individual user completion records Excluded by default
Gradebook Data All grades and grade history Excluded by default
Assignment Submissions Student submitted files and text Excluded by default
Forum Posts Discussion posts and replies Excluded by default
Quiz Attempts Student quiz attempt data Excluded by default
User Files Private user files in course Excluded by default
Logs Course activity logs Excluded by default
Comments User comments on activities Excluded by default
Badge Criteria Progress Badge completion progress Excluded by default

1.2 Activity-Specific Backup Content

Assignment Backups

  • Assignment description and instructions
  • Submission settings (types, deadlines, attempts)
  • Grading settings (rubrics, marking guides)
  • Feedback types configuration
  • Group submission settings
  • Optional: Student submissions and grades

Quiz Backups

  • Quiz settings and timing options
  • Question bank categories (course-level)
  • Individual questions and answers
  • Random question selections
  • Grade calculation settings
  • Optional: Student attempts and grades

Forum Backups

  • Forum type and settings
  • Subscription and tracking settings
  • Rating configurations
  • Optional: Discussion threads and posts
  • Optional: User subscriptions

Workshop Backups

  • Workshop phases and settings
  • Assessment forms and criteria
  • Grading strategies
  • Optional: Submissions and assessments

Database Activity Backups

  • Field definitions
  • Template designs
  • Preset configurations
  • Optional: User entries

Wiki Backups

  • Wiki type and settings
  • Page structures
  • Optional: Page content and history

Glossary Backups

  • Entry definitions
  • Category structures
  • Display formats
  • Optional: User entries

1.3 Files and Media

Backup file handling depends on where files are stored:

Course Backup File Structure:
├── moodle_backup.xml          # Master backup descriptor
├── files/                     # All backed up files
│   ├── [hash1]               # Individual files by content hash
│   ├── [hash2]
│   └── ...
├── course/                    # Course data
│   └── course.xml
├── activities/               # Activity data
│   ├── assign_123/
│   ├── quiz_456/
│   └── ...
├── sections/                 # Section data
│   ├── section_1/
│   └── ...
└── users.xml                 # User data (if included)

1.4 What's NOT Included in Course Backups

  • System-level question bank categories
  • User profile data beyond enrollments
  • Course category structure
  • External tool (LTI) credentials
  • Repository configurations
  • Plugin-specific external data
  • User authentication details
  • Site-wide badge definitions

2. Backup Settings and Options

2.1 Accessing Backup Settings

For Individual Course Backups: 1. Navigate to your course 2. Access Course Administration > Backup 3. Or use the gear icon > Backup

For Site-Wide Backup Settings: 1. Go to Site Administration 2. Navigate to Courses > Backups 3. Configure default settings

2.2 Initial Settings Page

When starting a backup, you'll encounter these setting categories:

Include Options

Setting Description Recommendation
Include enrolled users Backup user enrollment data Enable for full restore
Anonymize user information Replace real names with placeholders For sharing externally
Include user role assignments Preserve role configurations Enable for full restore
Include activities and resources Backup course content Always enable
Include blocks Backup sidebar blocks Enable for complete backup
Include filters Backup filter settings Enable if using filters
Include comments Backup activity comments Based on needs
Include badges Backup badge definitions Enable if using badges
Include calendar events Backup course calendar Enable for full backup
Include competencies Backup competency links Enable if using competencies
Include content bank content Backup H5P and other content Enable if using content bank
Include custom fields Backup custom course fields Enable if using custom fields
Include groups and groupings Backup group structures Enable if using groups
Include question bank Backup course question bank Essential for quizzes
Include permissions overrides Backup capability changes Enable for full restore

User Data Options

Setting Description Privacy Consideration
Include user files Personal files in course Contains PII
Include grade history Historical grade changes Contains PII
Include user completion Completion tracking data Contains PII
Include logs Activity log data Contains PII

2.3 Schema Settings

The schema settings page allows fine-grained control:

Activity Selection:
├── Section 1
│   ├── ☑ Assignment: Week 1 Essay
│   │   └── ☐ Include user data
│   ├── ☑ Quiz: Unit 1 Test
│   │   └── ☐ Include user data
│   └── ☑ Forum: Discussion 1
│       └── ☐ Include user data
├── Section 2
│   ├── ☑ Resource: Reading Materials
│   └── ☑ Page: Instructions
└── Section 3
    └── ☑ Assignment: Final Project
        └── ☐ Include user data

2.4 Confirmation and Execution

Before backup execution:

  1. Review Summary: Verify selected items
  2. Filename: Customize backup filename
  3. Default format: backup-courseshortname-date-time.mbz
  4. Example: backup-eng101-20250115-1430.mbz
  5. Destination: Choose where to store backup
  6. Course backup area
  7. User private files
  8. Download immediately

2.5 Default Backup Settings (Administrator)

Administrators can configure site-wide defaults:

Site Administration > Courses > Backups > General backup defaults

Recommended Defaults:
├── Include enrolled users: No
├── Anonymize user information: Yes
├── Include user role assignments: No
├── Include activities and resources: Yes
├── Include blocks: Yes
├── Include filters: Yes
├── Include comments: No
├── Include badges: Yes
├── Include calendar events: Yes
├── Include competencies: Yes
├── Include groups and groupings: Yes
├── Include question bank: Yes
└── Include permissions overrides: No

3. Automated Backups (Administrator)

3.1 Enabling Automated Backups

PulseLMS can automatically backup courses on a schedule. This requires administrator access.

Configuration Path: Site Administration > Courses > Backups > Automated backup setup

3.2 Automated Backup Settings

General Settings

Setting Options Recommendation
Active Disabled / Enabled / Manual Enabled
Schedule Days of week / Time Off-peak hours
Keep Number to retain 2-5 backups
Min kept Minimum backups 1
Max kept Maximum backups 10

Schedule Configuration

Automated Backup Schedule:
├── Run on: ☑ Sunday
│          ☐ Monday
│          ☐ Tuesday
│          ☐ Wednesday
│          ☐ Thursday
│          ☐ Friday
│          ☑ Saturday
├── Execute at: 02:00 (2 AM server time)
└── Skip courses modified after: Never

Course Selection

Option Description
All courses Backup every course
Courses modified since last backup Only changed courses
Specific categories Selected categories only
Skip hidden courses Exclude hidden courses

3.3 Storage Configuration

Backup Storage Settings:
├── Backup destination: Specified directory
├── Directory path: /var/backups/pulselms/automated/
├── Delete old backups: Yes
├── Keep this many: 3
└── Storage limit: 50 GB

3.4 Monitoring Automated Backups

Viewing Backup Status: 1. Go to Site Administration > Courses > Backups > Automated backup report 2. Review recent backup operations 3. Check for errors or warnings

Status Indicators: - OK: Backup completed successfully - Skipped: Course unchanged since last backup - Warning: Backup completed with issues - Error: Backup failed - Unfinished: Backup interrupted

3.5 Automated Backup Logs

Sample Backup Log Entry:
========================================
Backup started: 2025-01-15 02:00:05
Course: Introduction to Biology (BIO101)
Status: OK
Duration: 3 minutes 24 seconds
File size: 156.7 MB
Filename: backup-bio101-20250115-0200.mbz
========================================

Backup started: 2025-01-15 02:03:30
Course: Advanced Mathematics (MATH301)
Status: WARNING
Duration: 8 minutes 12 seconds
Warning: Large file truncated (video over 100MB limit)
File size: 89.3 MB
Filename: backup-math301-20250115-0200.mbz
========================================

3.6 Email Notifications

Configure email alerts for backup status:

Notification Settings:
├── Send to: [email protected], [email protected]
├── Send when:
│   ├── ☑ Backup fails
│   ├── ☑ Backup has warnings
│   └── ☐ Backup succeeds
└── Digest: Send daily summary at 06:00

3.7 Cron Job Requirements

Automated backups require proper cron configuration:

# PulseLMS Cron Job (Required for automated backups)
# Run every minute to allow PulseLMS scheduler to manage tasks
* * * * * /usr/bin/php /var/www/html/pulselms/admin/cli/cron.php >/dev/null

# Alternative: Dedicated backup cron (runs independently)
0 2 * * 0,6 /usr/bin/php /var/www/html/pulselms/admin/cli/automated_backups.php

4. Manual Backups

4.1 Creating a Manual Course Backup

Step-by-Step Process:

  1. Access Course Backup
  2. Navigate to your course
  3. Click gear icon (⚙) > Backup
  4. Or: Course Administration > Backup

  5. Initial Settings

  6. Select what to include (see Section 2)
  7. Choose whether to include user data
  8. Click Next

  9. Schema Settings

  10. Select specific activities to include
  11. Toggle user data per activity
  12. Click Next

  13. Confirmation

  14. Review backup summary
  15. Modify filename if desired
  16. Click Perform backup

  17. Completion

  18. Wait for backup to complete
  19. Download or note storage location
  20. Click Continue

4.2 Quick Backup (Default Settings)

For rapid backups using default settings:

  1. Navigate to your course
  2. Go to gear icon > Backup
  3. Click Jump to final step
  4. Review settings summary
  5. Click Perform backup

This uses administrator-configured defaults without customization options.

4.3 Backup with User Data

When including user data:

Important Considerations: - Increases backup file size significantly - Contains personally identifiable information (PII) - May be subject to data protection regulations (GDPR, FERPA) - Requires secure storage and handling

Enabling User Data: 1. On Initial Settings page, enable: - ☑ Include enrolled users - ☑ Include user role assignments 2. On Schema Settings, for each activity: - ☑ Include user information 3. This includes: - Enrollments - Submissions - Grades - Forum posts - Completion records

4.4 Anonymized Backups

For sharing courses externally:

  1. Enable Anonymize user information on Initial Settings
  2. Real names replaced with "User 1", "User 2", etc.
  3. Email addresses anonymized
  4. Profile pictures removed
  5. Useful for:
  6. Course templates
  7. Training materials
  8. External sharing
  9. Demonstration purposes

4.5 Partial Backups

Creating backups of specific content:

Backup Specific Sections: 1. Access Schema Settings 2. Uncheck unwanted sections 3. Keep desired sections checked

Backup Specific Activities: 1. Access Schema Settings 2. Expand each section 3. Uncheck individual activities to exclude

Backup Without Questions: 1. Uncheck "Include question bank" on Initial Settings 2. Note: Quiz content may be incomplete

4.6 Command Line Backups

For administrators, CLI backup provides additional options:

# Basic course backup
sudo -u www-data php /var/www/html/pulselms/admin/cli/backup.php \
    --courseid=123 \
    --destination=/var/backups/courses/

# Backup with all user data
sudo -u www-data php /var/www/html/pulselms/admin/cli/backup.php \
    --courseid=123 \
    --destination=/var/backups/courses/ \
    --users=all

# Backup without user data
sudo -u www-data php /var/www/html/pulselms/admin/cli/backup.php \
    --courseid=123 \
    --destination=/var/backups/courses/ \
    --users=none

# Backup multiple courses
for id in 101 102 103 104; do
    sudo -u www-data php /var/www/html/pulselms/admin/cli/backup.php \
        --courseid=$id \
        --destination=/var/backups/courses/
done

5. Downloading Backup Files

5.1 Accessing Backup Files

From Course Backup Area: 1. Navigate to course 2. Go to gear icon > Restore 3. Scroll to Course backup area 4. Click backup filename to download

From User Private Backup Area: 1. Go to user profile 2. Access Manage private files 3. Locate backup file 4. Click to download

From Automated Backup Storage: 1. Access server storage location 2. Navigate to configured backup directory 3. Copy or download files directly

5.2 Backup File Naming Conventions

Standard Naming Pattern:
backup-[shortname]-[date]-[time].mbz

Examples:
├── backup-eng101-20250115-1430.mbz
├── backup-bio201-fall2025-20250108-0930.mbz
├── backup-intro_chemistry-20241220-1600.mbz
└── backup-mgt500_leadership-20250112-1100.mbz

Automated Backup Pattern:
backup-[shortname]-[date]-[time]-auto.mbz

5.3 Managing Backup Storage

Course Backup Area Management: 1. Go to course > Restore 2. View Course backup area 3. Delete old backups to free space 4. Rename backups for organization

Storage Limits: - Course backup area: Typically 100MB default - Can be increased by administrators - Check available space before large backups

5.4 Backup File Structure

Understanding the .mbz file contents:

# Examining backup contents (Linux/Mac)
unzip -l backup-course101-20250115-1430.mbz

# Archive Contents:
├── moodle_backup.xml           # Backup metadata
├── moodle_backup.log           # Backup log
├── files.xml                   # File manifest
├── files/                      # Actual files
   ├── ab/
      └── abcd1234...        # Files stored by hash
   └── cd/
       └── cdef5678...
├── course/
   ├── course.xml             # Course settings
   ├── inforef.xml           # Cross-references
   └── roles.xml             # Role assignments
├── activities/
   ├── assign_123/
      ├── module.xml
      ├── assign.xml
      ├── grades.xml
      └── inforef.xml
   ├── quiz_456/
      ├── module.xml
      ├── quiz.xml
      └── questions.xml
   └── forum_789/
       ├── module.xml
       ├── forum.xml
       └── discussions.xml
├── sections/
   ├── section_0/
      └── section.xml
   ├── section_1/
      └── section.xml
   └── section_2/
       └── section.xml
├── users.xml                  # User data (if included)
├── groups.xml                 # Group data
├── outcomes.xml               # Learning outcomes
├── gradebook.xml             # Gradebook settings
├── scales.xml                # Custom scales
├── question_categories.xml   # Question bank categories
└── questions.xml             # Question data

5.5 Transferring Backup Files

Between PulseLMS Instances: 1. Download backup from source instance 2. Upload to destination instance user files 3. Access Restore on destination 4. Select uploaded file

To External Storage: 1. Download backup file 2. Transfer to external location: - Cloud storage (Google Drive, Dropbox, etc.) - External hard drive - Network attached storage 3. Maintain proper access controls


6. Course Restore - New Course vs Existing

6.1 Understanding Restore Options

PulseLMS offers three primary restore approaches:

Option Description Use Case
Restore to new course Creates fresh course Course duplication, new term
Restore to existing course Adds to current course Content merge, updates
Delete existing and restore Replaces course content Course reset

6.2 Restoring to a New Course

Step-by-Step Process:

  1. Access Restore Interface
  2. Navigate to any course or Site Administration
  3. Go to Restore
  4. Upload backup file or select from course backup area

  5. Select Backup File

  6. Upload new backup (.mbz file)
  7. Or choose from existing backups
  8. Click Restore

  9. Destination Selection

  10. Choose Restore as a new course
  11. Select target category
  12. Click Continue

  13. Settings Configuration

  14. Configure course settings
  15. Modify course name/shortname
  16. Set start date
  17. Click Next

  18. Schema Selection

  19. Select content to restore
  20. Choose user data options
  21. Click Next

  22. Process and Complete

  23. Review restoration summary
  24. Click Perform restore
  25. Wait for completion

6.3 Restoring to an Existing Course

Merge Content Options:

Option Behavior
Merge the backup course into this course Adds backup content to existing content
Delete the contents of this course and then restore Replaces all content

Merging Content: 1. Select Merge the backup course into this course 2. Existing content remains 3. Backup content added as new sections 4. May result in duplicate content if not careful

Replacing Content: 1. Select Delete the contents of this course and then restore 2. All existing content removed 3. Fresh content from backup restored 4. Use with caution - no undo

6.4 Restore Settings

Course Settings Override:

Setting Description Options
Overwrite course configuration Replace course settings Yes / No
Course name New course name Custom or from backup
Course short name New short name Custom or from backup
Course start date When course begins Custom or from backup
Keep current groups and groupings Preserve existing groups Yes / No
Keep current enrollments Preserve current users Yes / No

6.5 Selective Restoration

Restore only specific content:

  1. On Schema settings page, uncheck unwanted items:

    Restore Selection:
    ├── ☑ Section 1: Introduction
    │   ├── ☑ Page: Welcome
    │   └── ☐ Forum: Introductions (skip this)
    ├── ☑ Section 2: Content
    │   ├── ☑ Assignment: Homework 1
    │   └── ☑ Quiz: Unit Test
    └── ☐ Section 3: (skip entire section)
    

  2. Proceed with restore

  3. Only selected items restored

6.6 User Data Restoration

Restoring with User Data: - Requires backup that includes user data - Matches users by email or username - Creates new users if "Restore as new users" selected - Respects site authentication methods

User Matching Process: 1. System checks for existing users 2. Matches by email address first 3. Falls back to username matching 4. Unmatched users: skip or create new

User Data Conflicts: - Existing grades: keep or overwrite - Enrollments: merge or replace - Completion: preserve or restore

6.7 Post-Restore Verification

After restoration, verify:

  1. Course Structure
  2. All sections present
  3. Activities in correct locations
  4. Resources accessible

  5. Content Integrity

  6. Files open correctly
  7. Links functional
  8. Images display properly

  9. Settings Accuracy

  10. Dates adjusted correctly
  11. Completion settings intact
  12. Grade settings preserved

  13. User Data (if restored)

  14. Enrollments correct
  15. Grades present
  16. Submissions accessible

7. Import Course Data

7.1 Understanding Import vs Restore

Feature Import Restore
Source Another course on same site Backup file
User data Never included Optionally included
Speed Faster Variable
Use case Copy content between courses Full course recovery

7.2 Importing from Another Course

Step-by-Step Process:

  1. Access Import
  2. Navigate to destination course
  3. Go to gear icon > Import

  4. Select Source Course

  5. Browse available courses
  6. Search by name or short name
  7. Select source course
  8. Click Continue

  9. Initial Settings

  10. Choose what to import:

    • ☑ Include activities and resources
    • ☑ Include blocks
    • ☑ Include filters
    • ☑ Include calendar events
    • ☑ Include question bank
    • ☑ Include competencies
  11. Schema Settings

  12. Select specific items to import
  13. Expand sections for granular control
  14. Click Next

  15. Confirmation

  16. Review import summary
  17. Click Perform import

  18. Completion

  19. Wait for import to complete
  20. Review imported content
  21. Click Continue

7.3 Import Scenarios

Scenario 1: Importing a Single Activity 1. Start import process 2. On Schema settings, uncheck all sections 3. Expand desired section 4. Check only the activity to import 5. Complete import

Scenario 2: Importing Question Bank Only 1. On Initial Settings, uncheck all except "Include question bank" 2. Proceed through import 3. Only questions imported

Scenario 3: Importing Multiple Activities 1. Select multiple activities across sections 2. Activities imported to matching sections 3. New sections created if needed

7.4 Import Permissions

Who Can Import: - Users with 'import' capability in destination course - Typically: Teachers, Course creators, Managers - Must also have access to source course

Visibility of Source Courses: - Only courses where user has backup permission visible - Hidden courses may not appear - Site administrators see all courses

7.5 Import Best Practices

  1. Before Importing:
  2. Review source course content
  3. Plan section structure in destination
  4. Consider question bank organization

  5. During Import:

  6. Use descriptive section names
  7. Import related content together
  8. Check dependencies (e.g., quiz + questions)

  9. After Import:

  10. Verify all content transferred
  11. Update dates and deadlines
  12. Review completion settings
  13. Test links and resources

8. Backup/Restore Best Practices

8.1 Backup Strategy

Recommended Backup Frequency:

Course Type Backup Frequency Retention
Active course (high activity) Weekly 4 weeks
Active course (moderate) Bi-weekly 6 weeks
Completed course End of term 1 year
Template courses After each update All versions
Archive courses Once Indefinite

8.2 Pre-Backup Checklist

Before Creating Important Backups:
☐ Review course for sensitive data
☐ Remove unnecessary large files
☐ Clean up unused question bank entries
☐ Archive old forum discussions if not needed
☐ Verify all links are current
☐ Check file storage space availability
☐ Plan backup during low-usage hours
☐ Notify users if system may be slow

8.3 Backup Naming Conventions

Recommended Format:

[shortname]-[type]-[date]-[version].mbz

Examples:
├── eng101-full-20250115-v1.mbz           # Full backup
├── eng101-nouser-20250115-v1.mbz         # Without user data
├── eng101-template-20250115-v1.mbz       # Template version
├── eng101-archive-20250115-final.mbz     # End of term archive
└── eng101-questions-20250115.mbz         # Question bank only

8.4 Storage Best Practices

Local Storage: - Dedicated backup partition - Separate from PulseLMS installation - Regular disk space monitoring - RAID or redundant storage

Off-site Storage: - Encrypted cloud storage - Scheduled automatic transfers - Geographic redundancy - Tested restoration procedures

Retention Policy:

Backup Retention Schedule:
├── Daily automated backups: 7 days
├── Weekly backups: 4 weeks
├── Monthly backups: 12 months
├── Semester archives: 5 years
└── Compliance backups: As required

8.5 Security Considerations

Backup Security: 1. Encrypt backup files containing user data 2. Restrict access to backup storage 3. Use secure transfer methods (SFTP, encrypted upload) 4. Maintain access logs 5. Regular security audits

Data Protection:

Security Measures:
├── File encryption: AES-256
├── Transfer: SFTP or HTTPS only
├── Access: Role-based permissions
├── Storage: Encrypted at rest
├── Retention: Documented policy
└── Disposal: Secure deletion

8.6 Testing Backups

Regular Restore Testing: 1. Schedule quarterly restore tests 2. Use test environment for verification 3. Document test results 4. Address any issues found

Test Checklist:

Backup Restore Test:
☐ Backup file integrity check
☐ Complete restore to test instance
☐ Content verification
☐ File accessibility
☐ User data accuracy (if included)
☐ Grade data accuracy (if included)
☐ Plugin compatibility
☐ Performance assessment
☐ Document findings
☐ Update procedures if needed

8.7 Documentation

Maintain Backup Documentation: - Backup procedures and schedules - Storage locations and access info - Restoration procedures - Contact information for issues - Compliance requirements - Change log for procedures


9. Troubleshooting Large Backups

9.1 Common Size Issues

Causes of Large Backups: 1. Many video files embedded in course 2. Large document repositories 3. Extensive question bank with images 4. Multiple years of user data 5. Uncompressed image files 6. Redundant file uploads

9.2 Reducing Backup Size

Before Backup:

  1. Audit Course Content

    Size Reduction Steps:
    ├── Identify large files (Reports > Course overview)
    ├── Move videos to external streaming
    ├── Compress large images
    ├── Remove unused files
    ├── Archive old forum attachments
    └── Clean up assignment submissions
    

  2. External File Hosting

  3. Move large videos to YouTube/Vimeo
  4. Use cloud storage for large documents
  5. Embed external content rather than upload

  6. Question Bank Cleanup

  7. Remove unused questions
  8. Consolidate duplicate questions
  9. Optimize question images

9.3 PHP Configuration for Large Backups

Required PHP Settings:

; php.ini settings for large backups
max_execution_time = 7200        ; 2 hours
memory_limit = 512M              ; or higher for very large courses
post_max_size = 2048M            ; larger than max backup size
upload_max_filesize = 2048M      ; matches post_max_size
max_input_time = 7200            ; matches execution time

9.4 Server Configuration

Apache Settings:

# .htaccess or virtual host configuration
<Directory /var/www/html/pulselms>
    php_value max_execution_time 7200
    php_value memory_limit 512M
    php_value post_max_size 2048M
    php_value upload_max_filesize 2048M
</Directory>

# Timeout settings
Timeout 7200
ProxyTimeout 7200

Nginx Settings:

# nginx.conf
http {
    client_max_body_size 2048M;

    location ~ \.php$ {
        fastcgi_read_timeout 7200;
        fastcgi_send_timeout 7200;
    }
}

9.5 Command Line for Large Backups

CLI Backup for Large Courses:

# Use CLI to avoid browser timeouts
sudo -u www-data php /var/www/html/pulselms/admin/cli/backup.php \
    --courseid=123 \
    --destination=/var/backups/pulselms/

# With increased memory limit
sudo -u www-data php -d memory_limit=1024M \
    /var/www/html/pulselms/admin/cli/backup.php \
    --courseid=123 \
    --destination=/var/backups/pulselms/

# Background execution for very large backups
nohup sudo -u www-data php -d memory_limit=2048M \
    /var/www/html/pulselms/admin/cli/backup.php \
    --courseid=123 \
    --destination=/var/backups/pulselms/ \
    > /var/log/pulselms/backup-123.log 2>&1 &

9.6 Timeout Issues

Problem: Backup times out before completion

Solutions:

  1. Use CLI backup instead of web interface
  2. Split backup into parts
  3. Backup sections separately
  4. Combine using import

  5. Increase timeout settings

    Site Administration > Server > Session handling
    └── Increase session timeout
    

  6. Use asynchronous backup (if available)

9.7 Memory Errors

Problem: "Allowed memory size exhausted" error

Solutions:

  1. Increase PHP memory limit

    memory_limit = 1024M
    

  2. Check for memory leaks in plugins

  3. Disable non-essential plugins during backup
  4. Update all plugins to latest versions

  5. Backup without resource-heavy content

  6. Exclude large file areas
  7. Backup question bank separately

9.8 Disk Space Issues

Problem: "Not enough disk space" error

Solutions:

  1. Check available space

    df -h /var/www/html/pulselms
    df -h /tmp
    

  2. Clear temporary files

    sudo rm -rf /var/www/html/pulselms/temp/backup/*
    

  3. Use alternative temp directory

    // config.php
    $CFG->tempdir = '/path/to/larger/disk/temp';
    

  4. Clean up old backups

    find /var/www/html/pulselms/backup -name "*.mbz" -mtime +30 -delete
    

9.9 Backup Progress Monitoring

CLI Progress Monitoring:

# Monitor backup log in real-time
tail -f /var/log/pulselms/backup-123.log

# Check backup file size growth
watch -n 10 'ls -lh /var/backups/pulselms/*.mbz'

# Monitor PHP process
ps aux | grep backup.php

10. Site-Level Backups

10.1 Understanding Site Backups

Site-level backups protect the entire PulseLMS installation, including: - Database (all courses, users, configurations) - PulseLMS files (PulseLMS data directory) - Plugin installations - Custom configurations - Uploaded content

10.2 Database Backup

MySQL/MariaDB Backup:

# Basic database backup
mysqldump -u pulselms_user -p pulselms_db > pulselms_backup_$(date +%Y%m%d).sql

# Compressed backup
mysqldump -u pulselms_user -p pulselms_db | gzip > pulselms_backup_$(date +%Y%m%d).sql.gz

# With additional options for reliability
mysqldump -u pulselms_user -p \
    --single-transaction \
    --quick \
    --lock-tables=false \
    --routines \
    --triggers \
    pulselms_db > pulselms_backup_$(date +%Y%m%d).sql

PostgreSQL Backup:

# Basic database backup
pg_dump -U pulselms_user pulselms_db > pulselms_backup_$(date +%Y%m%d).sql

# Compressed backup
pg_dump -U pulselms_user pulselms_db | gzip > pulselms_backup_$(date +%Y%m%d).sql.gz

# Custom format for faster restore
pg_dump -U pulselms_user -Fc pulselms_db > pulselms_backup_$(date +%Y%m%d).dump

10.3 File System Backup

PulseLMS Data Directory:

# Backup PulseLMS data directory
tar -czf pulselmsdata_$(date +%Y%m%d).tar.gz /var/www/pulselmsdata/

# Backup with progress indicator
tar -czvf pulselmsdata_$(date +%Y%m%d).tar.gz /var/www/pulselmsdata/ 2>&1 | \
    pv -l > /dev/null

# Incremental backup using rsync
rsync -av --delete /var/www/pulselmsdata/ /backup/pulselmsdata/

Code Directory:

# Backup PulseLMS code (including plugins)
tar -czf pulselms_code_$(date +%Y%m%d).tar.gz /var/www/html/pulselms/

# Exclude unnecessary directories
tar -czf pulselms_code_$(date +%Y%m%d).tar.gz \
    --exclude='*.log' \
    --exclude='cache' \
    /var/www/html/pulselms/

10.4 Complete Site Backup Script

#!/bin/bash
# complete_backup.sh - Full PulseLMS site backup

# Configuration
BACKUP_DIR="/var/backups/pulselms"
DATE=$(date +%Y%m%d_%H%M%S)
PULSELMSDATA="/var/www/pulselmsdata"
PULSELMS_DIR="/var/www/html/pulselms"
DB_USER="pulselms_user"
DB_NAME="pulselms_db"
DB_PASS="your_password"  # Consider using .my.cnf instead
RETENTION_DAYS=30

# Create backup directory
mkdir -p "$BACKUP_DIR/$DATE"
cd "$BACKUP_DIR/$DATE"

# Enable maintenance mode
sudo -u www-data php "$PULSELMS_DIR/admin/cli/maintenance.php" --enable

# Backup database
echo "Backing up database..."
mysqldump -u "$DB_USER" -p"$DB_PASS" \
    --single-transaction \
    --quick \
    "$DB_NAME" | gzip > database_$DATE.sql.gz

# Backup PulseLMS data
echo "Backing up PulseLMS data..."
tar -czf pulselmsdata_$DATE.tar.gz "$PULSELMSDATA"

# Backup code (optional - usually in version control)
echo "Backing up code..."
tar -czf code_$DATE.tar.gz "$PULSELMS_DIR"

# Backup config file
cp "$PULSELMS_DIR/config.php" config_$DATE.php

# Disable maintenance mode
sudo -u www-data php "$PULSELMS_DIR/admin/cli/maintenance.php" --disable

# Create backup manifest
echo "Creating manifest..."
cat > manifest.txt << EOF
PulseLMS Complete Backup
========================
Date: $(date)
Database: database_$DATE.sql.gz
Data: pulselmsdata_$DATE.tar.gz
Code: code_$DATE.tar.gz
Config: config_$DATE.php

Checksums:
$(md5sum *)
EOF

# Clean up old backups
echo "Cleaning up old backups..."
find "$BACKUP_DIR" -maxdepth 1 -type d -mtime +$RETENTION_DAYS -exec rm -rf {} \;

echo "Backup complete: $BACKUP_DIR/$DATE"

10.5 Automated Site Backup with Cron

# /etc/cron.d/pulselms_backup

# Daily incremental backup at 2 AM
0 2 * * * root /usr/local/bin/pulselms_incremental_backup.sh >> /var/log/pulselms_backup.log 2>&1

# Weekly full backup on Sunday at 3 AM
0 3 * * 0 root /usr/local/bin/pulselms_full_backup.sh >> /var/log/pulselms_backup.log 2>&1

# Monthly archive on 1st at 4 AM
0 4 1 * * root /usr/local/bin/pulselms_archive_backup.sh >> /var/log/pulselms_backup.log 2>&1

10.6 Site Restoration

Full Site Restore Process:

#!/bin/bash
# restore_site.sh - Restore PulseLMS from backup

BACKUP_DIR="/var/backups/pulselms/20250115_020000"
PULSELMSDATA="/var/www/pulselmsdata"
PULSELMS_DIR="/var/www/html/pulselms"
DB_USER="pulselms_user"
DB_NAME="pulselms_db"

# Stop web server
sudo systemctl stop apache2

# Restore database
echo "Restoring database..."
gunzip < "$BACKUP_DIR/database_*.sql.gz" | mysql -u "$DB_USER" -p "$DB_NAME"

# Restore PulseLMS data
echo "Restoring PulseLMS data..."
rm -rf "$PULSELMSDATA"
tar -xzf "$BACKUP_DIR/pulselmsdata_*.tar.gz" -C /

# Restore code (if needed)
echo "Restoring code..."
rm -rf "$PULSELMS_DIR"
tar -xzf "$BACKUP_DIR/code_*.tar.gz" -C /

# Restore config
cp "$BACKUP_DIR/config_*.php" "$PULSELMS_DIR/config.php"

# Fix permissions
chown -R www-data:www-data "$PULSELMSDATA"
chown -R www-data:www-data "$PULSELMS_DIR"

# Clear cache
sudo -u www-data php "$PULSELMS_DIR/admin/cli/purge_caches.php"

# Start web server
sudo systemctl start apache2

echo "Restoration complete"

10.7 Cloud Backup Integration

AWS S3 Backup:

#!/bin/bash
# s3_backup.sh - Backup to AWS S3

BACKUP_DIR="/var/backups/pulselms"
S3_BUCKET="s3://your-pulselms-backups"
DATE=$(date +%Y%m%d)

# Sync backups to S3
aws s3 sync "$BACKUP_DIR" "$S3_BUCKET" \
    --delete \
    --storage-class STANDARD_IA \
    --exclude "*.log"

# Lifecycle policy handles old backup deletion

Google Cloud Storage:

#!/bin/bash
# gcs_backup.sh - Backup to Google Cloud Storage

BACKUP_DIR="/var/backups/pulselms"
GCS_BUCKET="gs://your-pulselms-backups"
DATE=$(date +%Y%m%d)

# Sync backups to GCS
gsutil -m rsync -r -d "$BACKUP_DIR" "$GCS_BUCKET"

10.8 Backup Verification

Verify Backup Integrity:

#!/bin/bash
# verify_backup.sh - Verify backup integrity

BACKUP_FILE="$1"

echo "Verifying backup: $BACKUP_FILE"

# Check file exists
if [ ! -f "$BACKUP_FILE" ]; then
    echo "ERROR: Backup file not found"
    exit 1
fi

# Check gzip integrity
if [[ "$BACKUP_FILE" == *.gz ]]; then
    if gzip -t "$BACKUP_FILE" 2>/dev/null; then
        echo "GZIP integrity: OK"
    else
        echo "ERROR: GZIP integrity check failed"
        exit 1
    fi
fi

# Check tar integrity
if [[ "$BACKUP_FILE" == *.tar.gz ]]; then
    if tar -tzf "$BACKUP_FILE" >/dev/null 2>&1; then
        echo "TAR integrity: OK"
    else
        echo "ERROR: TAR integrity check failed"
        exit 1
    fi
fi

# Check SQL dump
if [[ "$BACKUP_FILE" == *.sql.gz ]]; then
    # Quick check for valid SQL
    if gunzip -c "$BACKUP_FILE" | head -1 | grep -q "MySQL\|PostgreSQL\|-- "; then
        echo "SQL format: OK"
    else
        echo "WARNING: SQL format may be incorrect"
    fi
fi

echo "Verification complete"

10.9 Disaster Recovery Planning

Recovery Time Objectives:

Scenario RTO Target Recovery Method
Single course corruption 1 hour Course restore from backup
Database corruption 4 hours Database restore
Server failure 8 hours Full site restore
Data center failure 24 hours Offsite backup restore

Disaster Recovery Checklist:

Disaster Recovery Preparation:
☐ Documented recovery procedures
☐ Tested recovery in staging environment
☐ Offsite backup copies verified
☐ Recovery team contact information
☐ Service provider support contacts
☐ Communication plan for users
☐ Alternative access arrangements
☐ Regular DR drills scheduled

10.10 Backup Monitoring and Alerts

Monitoring Script:

#!/bin/bash
# monitor_backups.sh - Check backup status

BACKUP_DIR="/var/backups/pulselms"
ALERT_EMAIL="[email protected]"
MAX_AGE_HOURS=26  # Alert if backup older than 26 hours

# Find most recent backup
LATEST=$(find "$BACKUP_DIR" -name "*.sql.gz" -type f -printf '%T+ %p\n' | sort -r | head -1)

if [ -z "$LATEST" ]; then
    echo "CRITICAL: No backup files found" | mail -s "PulseLMS Backup CRITICAL" "$ALERT_EMAIL"
    exit 2
fi

# Check age
LATEST_FILE=$(echo "$LATEST" | cut -d' ' -f2)
AGE_SECONDS=$(( $(date +%s) - $(stat -c %Y "$LATEST_FILE") ))
AGE_HOURS=$(( AGE_SECONDS / 3600 ))

if [ $AGE_HOURS -gt $MAX_AGE_HOURS ]; then
    echo "WARNING: Latest backup is $AGE_HOURS hours old" | mail -s "PulseLMS Backup Warning" "$ALERT_EMAIL"
    exit 1
fi

echo "OK: Latest backup is $AGE_HOURS hours old"
exit 0

Quick Reference

Backup Commands Summary

Action Web Interface CLI Command
Course backup Course > Backup php admin/cli/backup.php --courseid=X
Automated backup Site admin > Backups php admin/cli/automated_backups.php
Database backup N/A mysqldump -u user -p db > backup.sql
File backup N/A tar -czf backup.tar.gz /path
Restore course Course > Restore php admin/cli/restore_backup.php

Troubleshooting Quick Reference

Issue Quick Fix
Backup timeout Use CLI, increase PHP timeout
Memory error Increase memory_limit
Disk space Clear temp files, old backups
Large backup Exclude user data, split backup
Corrupt backup Verify integrity, use latest good backup

Best Practices Summary

  1. Regular Backups: Weekly minimum, daily for active courses
  2. Test Restores: Quarterly in staging environment
  3. Offsite Storage: Cloud or remote location
  4. Documentation: Maintain current procedures
  5. Monitoring: Automated checks and alerts
  6. Security: Encrypt backups with user data
  7. Retention: Follow organizational policy
  8. Verification: Check backup integrity regularly

Additional Resources

  • PulseLMS Administration Guide: Site management procedures
  • PulseLMS Security Guide: Data protection guidelines
  • System Requirements: Server configuration reference
  • Plugin Management: Backup considerations for plugins

This documentation is for PulseLMS. For the latest updates and additional resources, consult your system administrator.