Upgrading XOOPS
This guide covers upgrading XOOPS from older versions to the latest release while preserving your data and customizations.
Version Information
- Stable: XOOPS 2.5.11
- Beta: XOOPS 2.7.0 (testing)
- Future: XOOPS 4.0 (in development - see Roadmap)
Pre-Upgrade Checklist
Section titled “Pre-Upgrade Checklist”Before beginning the upgrade, verify:
- Current XOOPS version documented
- Target XOOPS version identified
- Full system backup completed
- Database backup verified
- Installed modules list recorded
- Custom modifications documented
- Test environment available
- Upgrade path checked (some versions skip intermediate releases)
- Server resources verified (enough disk space, memory)
- Maintenance mode enabled
Upgrade Path Guide
Section titled “Upgrade Path Guide”Different upgrade paths depending on current version:
graph LR A[2.3.x] -->|Requires 2.4.x| B[2.4.x] B -->|Direct or via 2.5.x| C[2.5.x] A -->|Via 2.4.x| C C -->|Stable| D[2.5.11] E[2.5.0-2.5.10] -->|Direct| D D -->|Beta| F[2.7.0]Important: Never skip major versions. If upgrading from 2.3.x, first upgrade to 2.4.x, then to 2.5.x.
Step 1: Complete System Backup
Section titled “Step 1: Complete System Backup”Database Backup
Section titled “Database Backup”Use mysqldump to backup the database:
# Full database backupmysqldump -u xoops_user -p xoops_db > /backups/xoops_db_backup_$(date +%Y%m%d_%H%M%S).sql
# Compressed backupmysqldump -u xoops_user -p xoops_db | gzip > /backups/xoops_db_backup_$(date +%Y%m%d_%H%M%S).sql.gzOr using phpMyAdmin:
- Select your XOOPS database
- Click “Export” tab
- Choose “SQL” format
- Select “Save as file”
- Click “Go”
Verify backup file:
# Check backup sizels -lh /backups/xoops_db_backup*.sql
# Verify backup integrity (uncompressed)head -20 /backups/xoops_db_backup_*.sql
# Verify compressed backupzcat /backups/xoops_db_backup_*.sql.gz | head -20File System Backup
Section titled “File System Backup”Backup all XOOPS files:
# Compressed file backuptar -czf /backups/xoops_files_$(date +%Y%m%d_%H%M%S).tar.gz /var/www/html/xoops
# Uncompressed (faster, requires more disk space)tar -cf /backups/xoops_files_$(date +%Y%m%d_%H%M%S).tar /var/www/html/xoops
# Show backup progresstar -czf /backups/xoops_files_$(date +%Y%m%d_%H%M%S).tar.gz --verbose /var/www/html/xoops | tailStore backups securely:
# Secure backup storagechmod 600 /backups/xoops_*ls -lah /backups/
# Optional: Copy to remote storagescp /backups/xoops_* user@backup-server:/secure/backups/Test Backup Restoration
Section titled “Test Backup Restoration”CRITICAL: Always test your backup works:
# Verify tar archive contentstar -tzf /backups/xoops_files_*.tar.gz | head -20
# Extract to test locationmkdir /tmp/restore_testcd /tmp/restore_testtar -xzf /backups/xoops_files_*.tar.gz
# Verify key files existls -la xoops/mainfile.phpls -la xoops/install/Step 2: Enable Maintenance Mode
Section titled “Step 2: Enable Maintenance Mode”Prevent users from accessing the site during upgrade:
Option 1: XOOPS Admin Panel
Section titled “Option 1: XOOPS Admin Panel”- Log in to admin panel
- Go to System > Maintenance
- Enable “Site Maintenance Mode”
- Set maintenance message
- Save
Option 2: Manual Maintenance Mode
Section titled “Option 2: Manual Maintenance Mode”Create a maintenance file at web root:
<!DOCTYPE html><html><head> <title>Under Maintenance</title> <style> body { font-family: Arial; text-align: center; padding: 50px; } h1 { color: #333; } p { color: #666; margin: 20px 0; } </style></head><body> <h1>Site Under Maintenance</h1> <p>We're currently upgrading our site.</p> <p>Expected time: approximately 30 minutes.</p> <p>Thank you for your patience!</p></body></html>Configure Apache to show maintenance page:
# In .htaccess or vhost configErrorDocument 503 /maintenance.html
# Redirect all traffic to maintenance page<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REMOTE_ADDR} !^192\.168\.1\.100$ # Your IP RewriteRule ^(.*)$ - [R=503,L]</IfModule>Step 3: Download New Version
Section titled “Step 3: Download New Version”Download XOOPS from official site:
# Download latest versioncd /tmpwget https://xoops.org/download/xoops-2.5.8.zip
# Verify checksum (if provided)sha256sum xoops-2.5.8.zip# Compare with official SHA256 hash
# Extract to temporary locationunzip xoops-2.5.8.zipcd xoops-2.5.8Step 4: Pre-Upgrade File Preparation
Section titled “Step 4: Pre-Upgrade File Preparation”Identify Custom Modifications
Section titled “Identify Custom Modifications”Check for customized core files:
# Look for modified files (files with newer mtime)find /var/www/html/xoops -type f -newer /var/www/html/xoops/install.php
# Check for custom themesls /var/www/html/xoops/themes/# Note any custom themes
# Check for custom modulesls /var/www/html/xoops/modules/# Note any custom modules created by youDocument Current State
Section titled “Document Current State”Create an upgrade report:
cat > /tmp/upgrade_report.txt << EOF=== XOOPS Upgrade Report ===Date: $(date)Current Version: 2.5.6Target Version: 2.5.8
=== Installed Modules ===$(ls /var/www/html/xoops/modules/)
=== Custom Modifications ===[Document any custom theme or module modifications]
=== Themes ===$(ls /var/www/html/xoops/themes/)
=== Plugin Status ===[List any custom code modifications]
EOFStep 5: Merge New Files with Current Installation
Section titled “Step 5: Merge New Files with Current Installation”Strategy: Preserve Custom Files
Section titled “Strategy: Preserve Custom Files”Replace XOOPS core files but preserve:
mainfile.php(your database config)- Custom themes in
themes/ - Custom modules in
modules/ - User uploads in
uploads/ - Site data in
var/
Manual Merge Process
Section titled “Manual Merge Process”# Set variablesXOOPS_OLD="/var/www/html/xoops"XOOPS_NEW="/tmp/xoops-2.5.8"BACKUP="/backups/pre-upgrade"
# Create pre-upgrade backup in placemkdir -p $BACKUPcp -r $XOOPS_OLD/* $BACKUP/
# Copy new files (but preserve sensitive files)# Copy everything except protected directoriesrsync -av --exclude='mainfile.php' \ --exclude='modules/custom*' \ --exclude='themes/custom*' \ --exclude='uploads' \ --exclude='var' \ --exclude='cache' \ --exclude='templates_c' \ $XOOPS_NEW/ $XOOPS_OLD/
# Verify critical files preservedls -la $XOOPS_OLD/mainfile.phpUsing upgrade.php (If Available)
Section titled “Using upgrade.php (If Available)”Some XOOPS versions include automated upgrade script:
# Copy new files with installercp -r /tmp/xoops-2.5.8/* /var/www/html/xoops/
# Run upgrade wizard# Visit: http://your-domain.com/xoops/upgrade/File Permissions After Merge
Section titled “File Permissions After Merge”Restore proper permissions:
# Set ownershipchown -R www-data:www-data /var/www/html/xoops
# Set directory permissionsfind /var/www/html/xoops -type d -exec chmod 755 {} \;
# Set file permissionsfind /var/www/html/xoops -type f -exec chmod 644 {} \;
# Make writable directorieschmod 777 /var/www/html/xoops/cachechmod 777 /var/www/html/xoops/templates_cchmod 777 /var/www/html/xoops/uploadschmod 777 /var/www/html/xoops/var
# Secure mainfile.phpchmod 644 /var/www/html/xoops/mainfile.phpStep 6: Database Migration
Section titled “Step 6: Database Migration”Review Database Changes
Section titled “Review Database Changes”Check XOOPS release notes for database structure changes:
# Extract and review SQL migration filesfind /tmp/xoops-2.5.8 -name "*.sql" -type f# Document all .sql files foundRun Database Updates
Section titled “Run Database Updates”Option 1: Automated Update (if available)
Section titled “Option 1: Automated Update (if available)”Use admin panel:
- Log in to admin
- Go to System > Database
- Click “Check Updates”
- Review pending changes
- Click “Apply Updates”
Option 2: Manual Database Updates
Section titled “Option 2: Manual Database Updates”Execute migration SQL files:
# Connect to databasemysql -u xoops_user -p xoops_db
# View pending changes (varies by version)SELECT * FROM xoops_config WHERE conf_name LIKE '%version%';
# Run migration scripts manually if neededSOURCE /tmp/xoops-2.5.8/migrate_2.5.6_to_2.5.8.sql;Database Verification
Section titled “Database Verification”Verify database integrity after update:
-- Check database consistencyREPAIR TABLE xoops_users;OPTIMIZE TABLE xoops_users;
-- Verify key tables existSHOW TABLES LIKE 'xoops_%';
-- Check row counts (should increase or stay same)SELECT COUNT(*) FROM xoops_users;SELECT COUNT(*) FROM xoops_posts;Step 7: Verify Upgrade
Section titled “Step 7: Verify Upgrade”Homepage Check
Section titled “Homepage Check”Visit your XOOPS homepage:
http://your-domain.com/xoops/Expected: Page loads without errors, displays correctly
Admin Panel Check
Section titled “Admin Panel Check”Access admin:
http://your-domain.com/xoops/admin/Verify:
- Admin panel loads
- Navigation works
- Dashboard displays properly
- No database errors in logs
Module Verification
Section titled “Module Verification”Check installed modules:
- Go to Modules > Modules in admin
- Verify all modules still installed
- Check for any error messages
- Enable any modules that were disabled
Log File Check
Section titled “Log File Check”Review system logs for errors:
# Check web server error logtail -50 /var/log/apache2/error.log
# Check PHP error logtail -50 /var/log/php_errors.log
# Check XOOPS system log (if available)# In admin panel: System > LogsTest Core Functions
Section titled “Test Core Functions”- User login/logout works
- User registration works
- File upload functions
- Email notifications send
- Search functionality works
- Admin functions operational
- Module functionality intact
Step 8: Post-Upgrade Cleanup
Section titled “Step 8: Post-Upgrade Cleanup”Remove Temporary Files
Section titled “Remove Temporary Files”# Remove extraction directoryrm -rf /tmp/xoops-2.5.8
# Clear template cache (safe to delete)rm -rf /var/www/html/xoops/templates_c/*
# Clear site cacherm -rf /var/www/html/xoops/cache/*Remove Maintenance Mode
Section titled “Remove Maintenance Mode”Re-enable normal site access:
# Remove maintenance mode redirect from .htaccess# Or delete maintenance.html filerm /var/www/html/maintenance.htmlUpdate Documentation
Section titled “Update Documentation”Update your upgrade notes:
# Document successful upgradecat >> /tmp/upgrade_report.txt << EOF
=== Upgrade Results ===Status: SUCCESSUpgrade Date: $(date)New Version: 2.5.8Duration: [time in minutes]
Post-Upgrade Tests:- [x] Homepage loads- [x] Admin panel accessible- [x] Modules functional- [x] User registration works- [x] Database optimized
EOFTroubleshooting Upgrades
Section titled “Troubleshooting Upgrades”Issue: Blank White Screen After Upgrade
Section titled “Issue: Blank White Screen After Upgrade”Symptom: Homepage shows nothing
Solution:
# Check PHP errorstail -f /var/log/apache2/error.log
# Enable debug mode temporarilyecho "define('XOOPS_DEBUG', 1);" >> /var/www/html/xoops/mainfile.php
# Check file permissionsls -la /var/www/html/xoops/mainfile.php
# Restore from backup if neededcp /backups/xoops_files_*.tar.gz /tmp/cd /tmp && tar -xzf xoops_files_*.tar.gzIssue: Database Connection Error
Section titled “Issue: Database Connection Error”Symptom: “Cannot connect to database” message
Solution:
# Verify database credentials in mainfile.phpgrep -i "database\|host\|user" /var/www/html/xoops/mainfile.php
# Test connectionmysql -h localhost -u xoops_user -p xoops_db -e "SELECT 1"
# Check MySQL statussystemctl status mysql
# Verify database still existsmysql -u xoops_user -p -e "SHOW DATABASES" | grep xoopsIssue: Admin Panel Not Accessible
Section titled “Issue: Admin Panel Not Accessible”Symptom: Cannot access /xoops/admin/
Solution:
# Check .htaccess rulescat /var/www/html/xoops/.htaccess
# Verify admin files existls -la /var/www/html/xoops/admin/
# Check mod_rewrite enabledapache2ctl -M | grep rewrite
# Restart web serversystemctl restart apache2Issue: Modules Not Loading
Section titled “Issue: Modules Not Loading”Symptom: Modules show errors or are deactivated
Solution:
# Verify module files existls /var/www/html/xoops/modules/
# Check module permissionsls -la /var/www/html/xoops/modules/*/
# Check module configuration in databasemysql -u xoops_user -p xoops_db -e "SELECT * FROM xoops_modules WHERE module_status = 0"
# Reactivate modules in admin panel# System > Modules > Click module > Update StatusIssue: Permission Denied Errors
Section titled “Issue: Permission Denied Errors”Symptom: “Permission denied” when uploading or saving
Solution:
# Check file ownershipls -la /var/www/html/xoops/ | head -20
# Fix ownershipchown -R www-data:www-data /var/www/html/xoops
# Fix directory permissionsfind /var/www/html/xoops -type d -exec chmod 755 {} \;
# Make cache/uploads writablechmod 777 /var/www/html/xoops/cachechmod 777 /var/www/html/xoops/templates_cchmod 777 /var/www/html/xoops/uploadschmod 777 /var/www/html/xoops/varIssue: Slow Page Loading
Section titled “Issue: Slow Page Loading”Symptom: Pages load very slowly after upgrade
Solution:
# Clear all cachesrm -rf /var/www/html/xoops/cache/*rm -rf /var/www/html/xoops/templates_c/*
# Optimize databasemysql -u xoops_user -p xoops_db << EOFOPTIMIZE TABLE xoops_users;OPTIMIZE TABLE xoops_posts;OPTIMIZE TABLE xoops_config;ANALYZE TABLE xoops_users;EOF
# Check PHP error log for warningsgrep -i "deprecated\|warning" /var/log/php_errors.log | tail -20
# Increase PHP memory/execution time temporarily# Edit php.ini:memory_limit = 256Mmax_execution_time = 300Rollback Procedure
Section titled “Rollback Procedure”If upgrade fails critically, restore from backup:
Restore Database
Section titled “Restore Database”# Restore from backupmysql -u xoops_user -p xoops_db < /backups/xoops_db_backup_YYYYMMDD_HHMMSS.sql
# Or from compressed backupgunzip < /backups/xoops_db_backup_YYYYMMDD_HHMMSS.sql.gz | mysql -u xoops_user -p xoops_db
# Verify restorationmysql -u xoops_user -p xoops_db -e "SELECT COUNT(*) FROM xoops_users"Restore File System
Section titled “Restore File System”# Stop web serversystemctl stop apache2
# Remove current installationrm -rf /var/www/html/xoops/*
# Extract backupcd /var/www/htmltar -xzf /backups/xoops_files_YYYYMMDD_HHMMSS.tar.gz
# Fix permissionschown -R www-data:www-data xoops/find xoops -type d -exec chmod 755 {} \;find xoops -type f -exec chmod 644 {} \;chmod 777 xoops/cache xoops/templates_c xoops/uploads xoops/var
# Start web serversystemctl start apache2
# Verify restoration# Visit http://your-domain.com/xoops/Upgrade Verification Checklist
Section titled “Upgrade Verification Checklist”After upgrade completion, verify:
- XOOPS version updated (check admin > System info)
- Homepage loads without errors
- All modules functional
- User login works
- Admin panel accessible
- File uploads work
- Email notifications functional
- Database integrity verified
- File permissions correct
- Maintenance mode removed
- Backups secured and tested
- Performance acceptable
- SSL/HTTPS working
- No error messages in logs
Next Steps
Section titled “Next Steps”After successful upgrade:
- Update any custom modules to latest versions
- Review release notes for deprecated features
- Consider optimizing performance
- Update security settings
- Test all functionality thoroughly
- Keep backup files secure
Tags: #upgrade #maintenance #backup #database-migration
Related Articles:
- ../../06-Publisher-Module/User-Guide/Installation
- Server-Requirements
- ../Configuration/Basic-Configuration
- ../Configuration/Security-Configuration