It is important to back up the WordPress database regularly to prevent data loss. The backup can either be done manually or via a plugin
WordPress: Back up the database manually via phpMyAdmin
The database is the heart of every WordPress website. This is where posts, pages, comments and the website configuration are stored. Regular backups are therefore important. Many providers, such as Lima City, automatically back up both the database and the website to their servers on a daily basis. If your provider does not offer automatic backups, you can do this yourself.
- Log in to your web hosting account first and look for the phpMyAdmin tool there. Every web host provides this tool.
- After you have opened phpMyAdmin, you will see a list of databases on the left-hand side. Select the database that is assigned to your WordPress website
- If you find several entries there and are not sure which is the correct database, open the wp-config.php file in your WordPress installation directory via FTP in read-only mode. You will find the name of the database used in this file. Important: Do not make any changes to wp-config if you are not familiar with it, as this can lead to an error when establishing the database connection. Your website will then no longer be accessible.
- After you have selected the database, navigate to the “Export” tab in the top menu of phpMyAdmin.
- For a simple backup, select the export format as “SQL” and the method as “Quick – show only minimum necessary options”.
- Then click on “OK” or “Go” to start the export. The database is saved as a .sql file on your computer.
- To import a saved database to the server, click on the “Import” tab in the top menu. On the import page you will find a section “File to import”. Click on “Browse” or “Choose File” (depending on your browser) and select the backup file (.sql) from your computer. Click on the “OK”, “Start” or “Go” button at the bottom of the page to start the import.
- If you want to have these backups created automatically at a time interval you specify, you will need a plugin for WordPress.
WordPress: Backup via the plugin WP Database Backup
First you need WP Database Backup. In the WordPress dashboard, go to “Plugins” ☻ “Install” and enter “WP Database Backup” in the search field. Click on “Install now” next to the plugin and then activate it. After activation, WP-DB-Backup appears in the “Tools” menu under the “BackupforWP” entry. How to configure the plugin to back up your database:
- In the WordPress dashboard, select “Tools” ☻ “Backup”.
- On the backup page, you can select which tables are to be backed up. By default, all tables in the WordPress database are selected for backup.
- The plugin offers three options for performing the backup. Backup now immediately creates a backup file that you can download to your computer. Use Save backup to save the file on the server in a directory specified by the plugin. Alternatively, select Send backup by e-mail to send the backup file to an e-mail address you specify.
- If you prefer to have backups created automatically at intervals you specify, this is possible via the “Auto-Scheduler” tab. Here you can specify whether you only want to back up the database or the entire website. You can choose between daily, weekly and monthly intervals.
- To restore a backup, you must import the .sql file created by WP Database Backup into your WordPress database via phpMyAdmin as described above. The free version of the plugin does not offer a direct restore function. To use this, the paid Pro version is required. As of March 2024, this costs USD 9 per website for one year