WordPress uses a database to store all the content and settings for your WooCommerce store in a structured format.
The database organizes information such as products, customers, and orders into tables. A database export does not include site files such as uploads, themes, and plugins. Back up those files separately for a full-site backup.
You can learn more about the WordPress database here.
Please note that making changes to your site’s database can have major effects on the entire site. Always back up your site before making any database changes, and contact your hosting service for help if you’re unsure.
Note: This document is meant to serve as a helpful guide for advanced troubleshooting; however, the procedures described are beyond the scope of our support policy and we cannot provide direct assistance with implementing them.
If you would like to seek assistance from a qualified WordPress/WooCommerce developer, we highly recommend Codeable or a Woo Agency Partner.
Backing up or exporting your site database
↑ Back to topThis guide uses a tool called phpMyAdmin. Your hosting service may use the same tool or an alternative. Please reach out to them for help on this.
- Log in to phpMyAdmin:
- Start by accessing phpMyAdmin through your hosting control panel. This is usually found in sections like “Databases” within your web host’s dashboard.
- Select your database:
- Once you’re in phpMyAdmin, you’ll see a list of databases on the left side. Click on the database that you want to back up. This database contains all the data for your WordPress site, including WooCommerce information.
- Export the database:
- After choosing the database, click on the “Export” tab at the top of the screen.
- You will be presented with two options for exporting your database: “Quick” and “Custom”.
- Quick export: This option is straightforward and exports the entire database using the default settings.
- Custom export: This option allows for more control over the export process, such as choosing specific tables to back up, the output format, and setting other preferences.
- For most users, the “Quick” method is sufficient and simpler.
- Choose the format:
- Select a format for the export. An SQL file can be imported into a compatible MySQL or MariaDB database.
- Download the backup:
- Click on the “Go” button. phpMyAdmin will generate a download of your database backup in the format you have selected. Save this file to a secure location.
- It’s important to download and keep this file offsite or in cloud storage, so that it’s not only on your hosting server.
- Verify the backup:
- To check whether the backup can be restored, import it into a separate staging database and verify that the expected data is present. A completion line in the SQL file alone does not prove the backup is complete or restorable.
Importing your site database
↑ Back to topHere’s how to import a WordPress site database using phpMyAdmin
- Access phpMyAdmin:
- Log in to your hosting account and go to phpMyAdmin.
- Select the target database:
- In phpMyAdmin, select the target database from the list. Prefer a new, empty database for a test restore. Confirm the target with your host before importing into an existing database.
- Before importing:
- An import can overwrite existing data. Keep a verified backup and confirm the target database and restore procedure with your host. Do not drop tables unless you have confirmed exactly which data will be removed.
- Import the database:
- With the database selected, click on the “Import” tab at the top of the page.
- In the “File to import” section, click “Choose File” and select the SQL file you want to import. This should be the backup file or another SQL file that contains the data you wish to import.
- Leave the other options to their default settings, which are usually adequate for most WordPress database imports.
- Start the import process:
- Click on the “Go” button at the bottom of the page. phpMyAdmin will begin uploading and then importing the file into your selected database. This might take some time for larger file sizes.
- Check for errors:
- After the import is complete, phpMyAdmin will display a message showing the status of the import. If there are errors, it will provide details about what went wrong. Common issues could involve file size limits or SQL syntax errors.
- Update WordPress configuration (if needed):
- If you restore to a different database, ask your host to connect the intended site to that database. Do not point your live site to a database used for a staging test.
- Verify your site is working:
- Go to your WordPress site to make sure it is operating as expected. Check that all pages load properly and the content appears as expected.
Keep your site database secure
↑ Back to topUse these practices to protect your site’s database:
- Use strong passwords: Always use strong, unique passwords for your database access, and update them regularly.
- Update regularly: Keep your database software, WordPress, and any plugins or themes updated to close security vulnerabilities.
- Limit database access: Restrict access to your database to only necessary IP addresses to reduce the risk of attacks. Use database settings to block unknown IPs.
- Regular backups: Implement a schedule for regular backups and store them in a secure location to aid in quick recovery from data loss or breaches.
- Data encryption: Encrypt sensitive data in your database and ensure secure connections (like SSL/TLS) when accessing the database.
- Apply the least privilege principle: Only grant necessary permissions for users and applications to perform their required tasks.
- Monitor and audit: Keep an eye on access logs and set up alerts for unusual activities or unauthorized access attempts.
If you’re unsure how to make any of these changes, contact your hosting provider for assistance.
Questions and support
↑ Back to topDo you still have questions and need assistance?
- Get in touch with a Happiness Engineer via our Help Desk. We provide support for extensions developed by and/or sold on WooCommerce.com, and Jetpack/WordPress.com customers.
- If you are not a customer, we recommend finding help in the WooCommerce support forum or hiring a Woo Agency Partner. These are trusted agencies with a proven track record of building highly customized, scalable online stores. Learn more about Woo Agency Partners.