4

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?

MB34
  • 4,210
  • 12
  • 59
  • 110
  • I think everyone has their own approach for this. What we do for data sync would not work for you. We use rsnapshot for the file sync. – AllInOne Jul 03 '12 at 19:31

2 Answers2

3

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
Derek Hogue
  • 4,589
  • 1
  • 15
  • 27
  • +1 This is great, thank you so much! A bit late to the game, but I'm assuming you'd also need to add all of your `exp_channel_grid_field_*` tables to the content backup section too? – Chris Kempen Feb 11 '16 at 08:04
  • 1
    That's correct (this post is from the pre-Grid days). – Derek Hogue Feb 13 '16 at 19:05
0

This really is a question the depends A LOT on the type of site you're developing / updating. I typically overwrite the entire production database with the one from staging - but if you have a site that has commenting / or other member input it becomes much more complicated.

Philip Zaengle
  • 947
  • 4
  • 10