Magento 2 How to Backup My Cms Tables: Steps and Strategies
Has your Magento 2 store ever crashed after an update? Have you spent hours recreating content after accidental deletions? Magento 2 how to backup my cms tables helps manage static pages like "About Us" or reusable content blocks.
Over 60% of e-commerce sites experience data loss incidents each year. CMS content is the most vulnerable.
The tutorial explores the steps, strategies, and best practices for backing up CMS tables.
Key Takeaways
-
CMS tables store different types of content, including pages and widgets.
-
Follow the steps to back up your Magento 2 CMS tables from the admin panel.
-
Advanced strategies like cron jobs and off-site storage enable smarter CMS backups.
-
Compare different Magento 2 backup methods and find the one that fits your store.
-
Best practices for backup frequency and documentation help protect your content.
What are Magento 2 CMS Tables?
Magento 2 CMS tables are specific database tables. These store content managed through the platform's Content Management System.
These tables hold data for CMS pages and widgets. These widgets control the layout and content displayed on the storefront.
Each CMS tables pairs with store view tables to handle multi-store setups. These tables help manage non-product content, such as homepage banners and custom layouts.
Proper handling and regular backups of CMS tables help maintain your site's structure. It is especially when making design or content changes.
They help ensure consistency across the frontend experience. They also support multilingual or multi-store environments.
4 Types of Content Stored in CMS Tables
1. cms_page
Cms_page stores static content pages.
Examples: "About Us", "Privacy Policy", "Terms & Conditions", and custom landing pages.
Key Columns:
-
page_id – Unique ID of the page.
-
title – Page title.
-
identifier – URL key used for routing.
-
content – HTML content of the page.
-
is_active – Indicates publishing of the page.
2. cms_block
Cms_block stores reusable content blocks displayed throughout your site
Examples: Footer links, promotional banners, and sidebar content.
Key Columns:
-
block_id – Unique ID of the block.
-
title – Block title.
-
identifier – Programmatic key to insert blocks.
-
content – HTML/markup of the block.
-
is_active – Status of the block.
3. cms_page_version
Cms_page_version stores the version history of CMS pages for rollback and auditing. They store the history when we enable content staging.
Key Columns:
-
version_id – Unique ID for the version.
-
page_id – References the associated CMS page.
-
content – Versioned content.
-
created_at, created_by – Metadata about version creation.
4. cms_widget_instance
Cms_widget_instance stores widget configuration and placement data for CMS widgets.
Examples: Custom widgets placed on specific pages or layout positions.
Key Columns:
-
instance_id – Unique widget instance ID.
-
title – Name of the widget.
-
widget_parameters – Serialized data about the widget settings.
-
sort_order, page_group – Control display order and placement.
5 Steps to Back up My Magento 2 Cms Tables
1. Log in to your Magento 2 admin panel.
2. In the left-hand sidebar, go to System and select Backups.
3. In the Backups section, choose the backup type you want to create:
-
System Backup
-
Database Backup
-
Media Backup
Select Database Backup to include your CMS content.
4. After choosing your desired backup type, run the backup process. Magento 2 will create a snapshot of your current CMS data.
5. Once the backup is complete, check the list of backup entries to confirm its success.
7 Advanced Magento 2 CMS Tables Backup Strategies
1. Scheduled Automated Backups via Cron
-
Manual backups are inconsistent and error-prone. Automating them ensures that your CMS data is always up-to-date and secure.
-
Set up a cron job that performs regular MySQL dumps of only the CMS-related tables.
-
It runs daily at 2 AM and saves the backup with the current date. Store backups in a secure location with limited access permissions.
2. Offsite and Cloud Storage Integration
You might lose local backups if the server crashes. Off-site backups ensure data is recoverable even in catastrophic failures. Tools & services include:
-
Amazon S3
-
Google Cloud Storage
-
Dropbox, OneDrive, or Rclone
Combine it with a cron job to push new backups daily or weekly to a secure cloud location.
3. CMS Content Version Control
Magento Open Source doesn’t support full content versioning. Without it, it is hard to track who changed what or to roll back mistakes. The options include:
-
Magento Commerce has built-in content staging.
-
Magento Open Source users can export CMS content into version-controlled files.
Strategy:
-
Write a script to export the cms_page and cms_block tables as JSON or XML.
-
Store these files in a Git repository.
-
Commit changes with descriptive messages.
It provides a clear history and makes reverting or auditing changes easy.
4. Table-Level Backups & Granular Restoration
-
Restoring the entire database can be risky or time-consuming. Sometimes you need to restore CMS data after a mistake.
-
It allows precise recovery without affecting orders or customer data.
5. Backup Encryption and Retention Policies
-
Backups often contain sensitive content. It could become a liability if accessed by unauthorized users.
-
Use tools like GPG or OpenSSL to encrypt backups. Define how long you keep backups and purge older files to save storage.
-
Use a script or tool like logrotate or find to delete old backups.
6. Backup Validation and Restore Testing
A backup is only useful if it is restorable. Many businesses discover too late that their backup is corrupt or incomplete.
-
Restore backups to a staging environment weekly or monthly.
-
Confirm that key pages like the Homepage or Contact Us, have correct rendering.
-
Check for missing blocks or corrupted HTML.
Run a post-restore script that:
-
Verifies table counts.
-
Checks key identifiers.
-
Sends an alert if you find inconsistencies.
7. Use of Backup Extensions and Managed Tools
Third-party tools simplify backup tasks and offer user interfaces. It also helps add enterprise-grade features. Popular extensions include:
-
Aitoc CMS Backup exports or imports CMS pages and blocks.
-
Mirasvit Backup Manager
-
JetBackup, Acronis for hosting environments.
Features to Look For:
-
Incremental backups
-
Scheduled tasks
-
One-click restore
-
Multistore compatibility
3 Different Magento 2 Backup Methods
1. Admin Panel Backup
Pros:
-
It needs no coding or command-line knowledge.
-
It is available in the Magento admin interface.
-
It displays backup history and statuses.
Cons:
-
Starting from Magento 2.3.x+, the built-in backup feature is often disabled. They disable it by default for security reasons.
-
It only allows full, system, or media/database backup; it is not selective.
-
It may timeout or slow down your site during execution.
Best For:
-
Small store owners.
-
Beginners with no access to the server or a technical background.
-
Occasional and manual backups for content edits or small updates.
2. Command Line Interface Backup
Pros:
-
You can back up only the CMS tables or the entire database.
-
It works well with cron jobs for daily/nightly backups.
-
It is faster and more reliable than the web interface, especially for large databases.
-
You can combine it with cloud uploads, including AWS S3 and Google Cloud.
Cons:
-
Not all hosting environments provide SSH access.
-
It is not beginner-focused; it needs knowledge of Linux commands.
Best For:
-
Medium to large-scale Magento stores.
-
Developers and DevOps teams.
-
Stores with automated deployment and staging environments.
3. phpMyAdmin
Pros:
-
It is easier for non-developers to navigate compared to the terminal.
-
You can export only cms_page, cms_block, or any specific table.
-
It works even if Magento is down, since it interfaces with the database.
Cons:
-
It needs you to log in and perform backups.
-
It is not suitable for large databases.
-
Misclicks can result in exporting the wrong tables or deleting data.
Best For:
-
Content managers and editors.
-
On-demand, targeted table backups.
-
Troubleshooting specific CMS data issues.
4 Best Practices for Magento 2 Backup Management
1. Recommended backup frequency
-
The frequency of backups should align with how often your site’s content and data change.
-
A weekly backup may suffice for stores with minimal updates, such as those with a static catalog.
-
If your store undergoes regular updates, it is best to perform daily backups to cut data loss risk.
-
High-traffic or dynamic sites should undergo automated backups at various times per day.
-
Automate backups using cron jobs to avoid human error. Use incremental backups for large stores to reduce load and storage usage.
2. Security considerations
Proper backup security ensures that your data is not stolen or deleted.
Access Restrictions
-
Limit backup access to authorized personnel, such as developers or sysadmins.
-
Store backups in directories outside the web root.
-
Set read/write permissions.
Encryption
-
Encrypt backups at rest using tools like GPG or OpenSSL.
-
Use encrypted cloud storage, such as AWS S3 with server-side encryption.
-
Encrypt transfer with SFTP or HTTPS.
Secure Storage Locations
-
Store backups in various locations.
-
Use immutable backup snapshots when available.
3. Documentation best practices
Clear documentation ensures that any team member can understand. They can also execute the backup and restore process.
The document should include:
-
Backup types and locations.
-
Schedule and frequency.
-
Encryption steps and key management.
-
Restore procedures, step-by-step.
-
Verification checklist after restore.
Store documentation in version-controlled internal wiki tools. These include Confluence or Git-based README files.
4. Integration with development workflows
Integrating backup processes into your dev cycle improves content safety and team efficiency.
Use backups in:
-
Import CMS table backups into staging deployments to mirror live content.
-
Always take a snapshot before applying Magento patches or content changes.
-
Maintain point-in-time backups before major deployments.
Automation Tools:
-
Include backup steps in CI/CD pipelines, such as Jenkins or GitHub Actions.
-
Create pre- and post-deployment hooks that trigger backup/restore.
Example Git-based CMS Workflow:
1. Export CMS content as JSON/XML.
2. Store in Git with commit messages.
3. Pull and apply to staging before tests.
FAQs
1. How do I backup only my CMS tables in Magento 2?
Use phpMyAdmin to select specific tables, such as cms_page or cms_block, for export. Use the targeted mysqldump command provided in Method 2.
2. Can I automate Magento 2 database backups?
You can automate Magento 2 database backups through cron jobs. Use Magento CLI commands or third-party backup extensions with scheduling capabilities.
3. Where are Magento 2 backups stored?
Store admin-generated backups in the var/backups directory of your Magento installation. Store the command line and phpMyAdmin backups wherever you specify. It is during the backup process.
4. Is it safe to back up while the store is live?
You should enable maintenance mode during backups. It helps prevent data inconsistencies, especially for high-traffic stores.
5. How often should I back up my Magento 2 store?
At least, back up after significant content changes and before any system updates. We recommend daily backups for active stores.
Summary
Magento 2 how to backup my cms tables that support multi-store and multilingual setups. The tutorial explores the features of the process, including:
-
cms_page, cms_block, and cms_page_version store content and layout settings.
-
Each Admin Panel and CLI suits different user needs and technical levels.
-
Use cron jobs, encryption, version control, and restore testing for backup management.
-
Automate backups, restrict access, and integrate backups with development pipelines.
Ensure your content is always secure and recoverable with reliable backup strategies. Choose managed Magento hosting for automated backups and smooth CMS performance.