◦ Comprehensive security
◦ 24/7 support
Magento Guide → Security → Backup My CMS Tables
How to backup my CMS tables on Magento 2
Your CMS content—like pages and static blocks—helps shape your Magento storefront. Losing it during a failed update or server crash can be a nightmare. Fortunately, Magento 2 includes simple tools for backing up your CMS tables safely. Whether you’re using the Admin Panel, the command line, or automated jobs, backing up takes just a few minutes and can save you hours of recovery work.
Let’s walk through exactly how to do it, one step at a time.
Host Magento at full throttle.
Get secure, reliable Magento hosting so you can scale faster.
Understanding where CMS data lives in Magento 2
Magento’s CMS features let you build pages, banners, and reusable content blocks. All this information is stored in your Magento database, not in code files.
The CMS-related tables you’ll be backing up include:
- cms_page – for custom pages like Home or About Us
- cms_block – for static blocks used in layout or promotions
- cms_page_store and cms_block_store – for store view associations
Any full database backup will automatically include these tables. You don’t need to separate them out unless you’re doing something advanced like migrating just the CMS content.
1. Backing up CMS tables using the Admin Panel
The easiest way for beginners to back up CMS tables is through Magento’s built-in Admin Panel tool.
- Log in to your Magento Admin Panel. Go to your backend login page (usually something like yourdomain.com/admin) and sign in.
- Navigate to System > Tools > Backups. In the left-hand menu, scroll down to System, then choose Tools, and click on Backups.
- Choose the type of backup you want. You’ll see three options:
- System Backup: Includes everything—code files, media, and the database.
- Database and Media Backup: Saves the database plus your product/media images.
- Database Backup: Only backs up your database (which includes CMS tables).
- If you only need to protect your CMS data, choose Database Backup.
- (Optional) Enable maintenance mode. Before running the backup, check the box that says Put store on maintenance mode. This prevents customers from making changes while the backup is running, which helps avoid data corruption.
- Click the backup button. Select the backup type you want and hit the corresponding button. Magento will start the process and show a loading icon or progress indicator.
- Wait for confirmation. After a few moments, your backup will appear in the list at the bottom of the page. You can also find it saved in the /var/backups/ folder on your server.
Note: If you don’t see the backup options in your Admin Panel, go to Stores > Configuration > Advanced > System > Backup Settings and make sure the backup tool is enabled.
2. Backing up using the Magento CLI
The Magento command line (also called the CLI) is a powerful tool that lets you perform advanced tasks—including backups—with more precision and control.
- Connect to your server via SSH. You’ll need access to your Magento server. Use a tool like Terminal (macOS/Linux) or PuTTY (Windows) to SSH in.
ssh your-user@your-server-ip - Navigate to your Magento 2 root directory.
Use the cd command to get to your Magento installation. It might look like this:
cd /var/www/html
If you’re not sure where Magento is installed, ask your hosting provider. - Run the backup command. Magento’s CLI command for backups looks like this:
php bin/magento setup:backup –db
This will back up just your database, including the CMS tables. You can also add:
–media for media files (images, videos)
–code for core Magento and custom code - Wait for the process to finish. You’ll see messages confirming that the backup has started and completed. If there are any permission errors, Magento will let you know.
- Find the backup files. Magento saves CLI backups in the /var/backups/ directory of your project.
3. Automating backups with cron jobs
If you want your CMS data to be backed up regularly (e.g. daily), you can set up a cron job. This is a simple scheduled task that runs your backup commands automatically.
- Create a shell script to run the backup. Open your text editor and create a file named magento-db-backup.sh:
#!/bin/bash
cd /var/www/html
php bin/magento setup:backup –db
Replace /var/www/html with the actual path to your Magento install. - Make the script executable. Run this command:
chmod +x magento-db-backup.sh - Edit your crontab. Run:
crontab -e - Add a cron job to schedule the script. To run it every day at 2 AM, add:
0 2 * * * /path/to/magento-db-backup.sh
Make sure to use the full path to your script file.
This method keeps your CMS backups up to date without manual effort—and it’s one of the best ways to protect your store long-term.
Troubleshooting common backup issues
Sometimes backups don’t go as planned. Here are a few common problems and how to solve them.
Backup options not showing in Admin Panel:
Go to Stores > Configuration > Advanced > System > Backup Settings and set Enable Backup to “Yes.”
Permission errors during backup:
Check that the var/, pub/, and generated/ directories are writable. Use:
chmod -R 775 var/ pub/ generated/
Store stuck in maintenance mode:
If your store stays offline after a backup, delete the maintenance flag:
rm var/.maintenance.flag
Timeouts during backup:
Increase the max_execution_time in your php.ini or run the backup using the CLI instead of the Admin Panel.
Bonus: Selectively backing up CMS tables via MySQL
If you’re migrating CMS data or want a very lightweight backup, you can export only the CMS-related tables using a MySQL dump.
- Log in to your server via SSH.
- Run this command:
mysqldump -u your_db_user -p your_db_name \
cms_block cms_block_store cms_page cms_page_store \
> cms_backup.sql
Replace your_db_user and your_db_name with your actual database login and name. - Enter your MySQL password when prompted.
This method is best for developers or advanced users who need CMS data separate from products, orders, or customers.
Next steps for backing up CMS tables on Magento 2
Backing up CMS tables in Magento 2 protects the layout and content of your store. Whether you use the Admin Panel or CLI, backups are your safety net against data loss.
If you haven’t already, set up automated cron backups to run daily or weekly. It takes five minutes to configure and could save you hours of work later.
Ready to upgrade your Magento experience? Professional hosting improves speeds, security, and reliability for a website and a brand that people find engaging and trustworthy.
Liquid Web offers the raw infrastructure power you need with mission-critical features that keep your store running smoothly. Most importantly, our in-house Magento experts are standing by to help with both hosting and Magento application roadblocks.
Click through below to explore all of our Magento hosting options, or chat with an expert right now to get answers and advice.
Ready to get started?
Get the fastest, most secure Magento hosting on the market
Additional resources
What is Magento Ecommerce? →
A complete beginner’s guide to the Magento Ecommerce platform
Magneto vs. WordPress →
Compare pricing, hosting, security, SEO, and a lot more
Best Magento ERP extensions →
Our top 10 compared so you can decide which is best for your business