Search code examples
mysqlexpressionengine

ExpressionEngine->What tables to backup?


We have a deployment process where we are required to create a “rollback” point before a release is committed to our live server.

We have a staging server where all release candidate code is tested. Now this staging server also includes all the channel data, content, etc that is modified before a release. These two tables are identical copies with the exception of one of our global variables {site_url_https}

We will create a mysqldump of the production server’s DB before the release to create the rollback point. We will then create a mysqldump of the staging server’s DB and apply it to the production server’s DB to complete the release.

What tables would I need to backup in order to provide a rollback point before a release is applied? This should include all changes to content, channel data, categories, custom fields, etc. What tables would I need to “copy” from the staging to the production server?

I have a script to create the SQL backup file and will post it after testing.

Also, is there a function that I can call from a script that will synchronize the templates table with the template files?


Solution

  • Some of these might be moot if you're not using certain features (like comments, entry versioning, etc).

    To backup all content, categories and comments:

    • exp_category_posts
    • exp_channel_data
    • exp_channel_entries_autosave
    • exp_channel_titles
    • exp_comments
    • exp_relationships
    • exp_revision_tracker

    To backup field/channel/category structure and settings:

    • exp_categories
    • exp_category_field_data
    • exp_category_fields
    • exp_category_groups
    • exp_channel_fields
    • exp_channel_member_groups
    • exp_channels
    • exp_entry_ping_status
    • exp_entry_versioning
    • exp_field_formatting
    • exp_field_groups
    • exp_fieldtypes
    • exp_file_categories
    • exp_file_dimensions
    • exp_file_watermarks
    • exp_files
    • exp_layout_publish
    • exp_status_groups
    • exp_status_no_access
    • exp_statuses
    • exp_upload_no_access
    • exp_upload_prefs

    To backup templates and related:

    • exp_global_variables
    • exp_snippets
    • exp_specialty_templates
    • exp_template_groups
    • exp_template_member_groups
    • exp_template_no_access
    • exp_templates

    To backup member-related data:

    • exp_member_bulletin_board
    • exp_member_data
    • exp_member_fields
    • exp_member_groups
    • exp_member_homepage
    • exp_member_search
    • exp_members
    • exp_module_member_groups

    To backup installation of new modules, extensions, changed site settings more generally:

    • exp_accessories
    • exp_actions
    • exp_extensions
    • exp_html_buttons
    • exp_modules

    If you're using MSM:

    • exp_sites