Skip to content

Deleting Module Features

This guide explains safe practices for deleting features, custom fields, and module components, including data backup, impact assessment, and cleanup procedures.


Table of Contents

  1. Overview
  2. Safe Deletion Practices
  3. Data Backup Before Deletion
  4. Removing Custom Fields
  5. Cleaning Up Related Data
  6. Impact Assessment
  7. Best Practices

Overview

What Can Be Deleted

  • ✅ Custom fields
  • ✅ Module content
  • ✅ Unused features
  • ✅ Temporary data
  • ✅ Test data

What Cannot Be Deleted

  • ❌ Core system fields
  • ❌ Required relationships
  • ❌ Critical data
  • ❌ Active content

Important Warnings

⚠️ Deletion is Permanent:

  • Deleted data cannot be recovered
  • Always backup before deletion
  • Test in development first
  • Verify impact before deleting

Safe Deletion Practices

Pre-Deletion Checklist

Before Deleting Anything

  1. Backup Data:

    • ✅ Full database backup
    • ✅ File backups
    • ✅ Configuration backups
  2. Assess Impact:

    • ✅ Identify dependencies
    • ✅ Check relationships
    • ✅ Review usage
  3. Test in Development:

    • ✅ Test deletion process
    • ✅ Verify no errors
    • ✅ Check functionality
  4. Document:

    • ✅ Document what's being deleted
    • ✅ Note reasons
    • ✅ Record date/time

Deletion Process

Step-by-Step Process

  1. Identify What to Delete:

    • Determine what needs deletion
    • Verify it's safe to delete
    • Check for dependencies
  2. Backup:

    • Create full backup
    • Verify backup integrity
    • Store backup safely
  3. Test:

    • Test in development
    • Verify deletion works
    • Check for errors
  4. Delete:

    • Perform deletion
    • Verify completion
    • Check for errors
  5. Verify:

    • Verify deletion successful
    • Check related functionality
    • Monitor for issues

Data Backup Before Deletion

Database Backup

Full Backup

Methods:

  • cPanel: Use phpMyAdmin export
  • Command Line: Use mysqldump
  • Backup Tools: Use backup scripts

Command Example:

bash
mysqldump -u username -p database_name > backup.sql

Selective Backup

Backup Specific Tables:

  • Custom fields table
  • Custom field values
  • Related data tables

File Backup

Backup Files

What to Backup:

  • Configuration files
  • Custom templates
  • Uploaded files
  • Custom code

Methods:

  • FTP: Download via FTP
  • SSH: Use scp or rsync
  • cPanel: Use File Manager

Backup Verification

Verify Backup

  1. Check Backup File:

    • Verify file exists
    • Check file size
    • Verify integrity
  2. Test Restore:

    • Test restore process
    • Verify data integrity
    • Check functionality

Removing Custom Fields

Deleting Custom Fields

Step 1: Access Custom Fields

  1. Navigate to Custom Fields:
    • Go to module
    • Click Custom Fields
    • Find field to delete

Step 2: Review Field

  1. Check Usage:

    • Check if field is used
    • Review field values
    • Identify dependencies
  2. Assess Impact:

    • What data will be lost
    • What features affected
    • What needs updating

Step 3: Backup

  1. Export Field Data:
    • Export field values
    • Save to file
    • Store safely

Step 4: Delete Field

  1. Click Delete:

    • Click Delete button
    • Confirm deletion
    • Field deleted
  2. Verify:

    • Field removed from list
    • Forms updated
    • No errors

Field Value Cleanup

After Field Deletion

  1. Check Values:

    • Field values may remain
    • May need manual cleanup
    • Check database
  2. Clean Up:

    • Remove orphaned values
    • Clean database
    • Verify cleanup

Foreign Key Relationships

What to Check:

  • Related records
  • Foreign key constraints
  • Dependent data

Cleanup:

  • Delete related records first
  • Or set to null
  • Or reassign

Polymorphic Relationships

What to Check:

  • Polymorphic associations
  • Related models
  • Dependent data

Cleanup:

  • Remove associations
  • Clean up references
  • Verify cleanup

Data Cleanup Process

  1. Find Dependencies:
    • Check relationships
    • Review foreign keys
    • Identify related records

Step 2: Clean Up

  1. Delete Related Data:
    • Delete dependent records
    • Remove associations
    • Clean references

Step 3: Verify

  1. Check Cleanup:
    • Verify data removed
    • Check for orphans
    • Verify integrity

Impact Assessment

Before Deletion

Assess Impact

  1. Identify Dependencies:

    • What depends on this
    • What uses this
    • What references this
  2. Check Usage:

    • Where is it used
    • How is it used
    • Who uses it
  3. Evaluate Impact:

    • High/Medium/Low impact
    • Critical/Non-critical
    • Reversible/Irreversible

Impact Categories

High Impact

Characteristics:

  • Used in multiple places
  • Critical functionality
  • Active data
  • Many dependencies

Action:

  • Extra caution required
  • Extensive testing
  • Detailed backup
  • Staged deletion

Medium Impact

Characteristics:

  • Limited usage
  • Some dependencies
  • Moderate importance

Action:

  • Standard precautions
  • Normal testing
  • Standard backup

Low Impact

Characteristics:

  • Minimal usage
  • Few dependencies
  • Low importance

Action:

  • Basic precautions
  • Quick testing
  • Basic backup

Best Practices

Before Deletion

  1. Always Backup:

    • Full backup required
    • Verify backup works
    • Store safely
  2. Test First:

    • Test in development
    • Verify process
    • Check for errors
  3. Document:

    • Document what's deleted
    • Note reasons
    • Record date/time

During Deletion

  1. Be Careful:

    • Double-check selection
    • Verify correct item
    • Confirm before deleting
  2. Monitor:

    • Watch for errors
    • Check logs
    • Monitor system
  3. Verify:

    • Verify deletion complete
    • Check related items
    • Verify no errors

After Deletion

  1. Verify Functionality:

    • Test all features
    • Check for errors
    • Verify data integrity
  2. Clean Up:

    • Remove orphaned data
    • Clean database
    • Update references
  3. Update Documentation:

    • Update documentation
    • Note deletions
    • Update guides

Troubleshooting

Deletion Failed

Solutions:

  1. Check permissions
  2. Verify item exists
  3. Check dependencies
  4. Review error messages
  5. Try again

Data Still Exists

Solutions:

  1. Check database directly
  2. Verify deletion completed
  3. Clear cache
  4. Check for soft deletes
  5. Manual cleanup if needed

Solutions:

  1. Check relationships
  2. Verify foreign keys
  3. Clean up references
  4. Restore from backup if needed
  5. Fix errors


Last Updated: [Date will be updated during final review]

Released under the MIT License.