Sometimes you do not want to restore the whole backup, but only the database, only the plugins or only the uploads. In the Extended view, you choose which parts of the backup the restore replaces.
What can be chosen
A backup consists of roots. A root is a named part of the website: the database or a folder.
| Root | Content | Name on the command line |
|---|---|---|
| Database | The tables of the website. | db |
| wp-content (everything else) | Everything in wp-content that does not belong to any of the four following roots: drop-ins, language files, folders of other plugins. |
wp-content |
| Plugins | The folder of the plugins. | wp-plugins |
| Themes | The folder of the themes. | wp-themes |
| Must-use plugins | The folder of the must-use plugins. | wp-mu-plugins |
| Uploads | The folder of the uploads. | wp-uploads |
| WordPress core | The folders wp-admin and wp-includes and the files that WordPress ships in the root folder. |
wp-core |
| Root folder files (.htaccess, robots.txt, …) | Everything else in the root folder of the website. | wp-root |
The smallest unit is the root
Individual folders, files or tables cannot be chosen. The restore always restores the database as a whole.
Step 1: Open the preparation in the Extended view
Open the Restore page and switch to Extended. The switch is at the bottom of the page, below the last tile. Then, in the row of the backup, open More …, then Restore.
- The roots that the backup contains. What is ticked is what the restore restores.
- wp-config.php is never restored.
- Do not restore WordPress core
- Do not restore drop-ins (object-cache.php, advanced-cache.php, db.php)
- Do not restore .htaccess, web.config, .user.ini
- Remove everything that is not in the backup is underlined with dots: the tooltip explains the switch.
- Leave out damaged entries (otherwise a damaged entry stops the restore)
- Leave out entries that cannot be created (otherwise such an entry stops the restore)
Step 2: Choose the roots
When the preparation opens, every root of the backup is ticked. Remove the tick from everything that should stay as it is. For a restore of only the database, leave only Database ticked; for plugins and themes, only Plugins and Themes.
No tick means: everything
If no root is ticked, the restore restores the whole backup. The same applies if you switch back to Compact. The confirmation dialog before the start lists what is restored, in three groups: database, files, WordPress core. If it lists more than you chose, cancel and check the ticks.
Step 3: Check the switches
The switches always show what will happen: your choice or the default of the pre-check. Until the first pre-check has answered, a notice is shown in their place. For the first three switches, a tick means that the item is left out.
| Switch | Default | Ticked |
|---|---|---|
| Do not restore WordPress core | Backup of this website: not ticked. Backup of a different website or of unknown origin: ticked. | The core of this website stays as it is. If the backup contains no core, the switch is disabled. |
| Do not restore drop-ins (object-cache.php, advanced-cache.php, db.php) | As with the core. | The three files from the backup are left out. This website’s own drop-ins are moved to the previous state during the restore of wp-content (everything else), like other entries there that do not come from the backup. |
| Do not restore .htaccess, web.config, .user.ini | As with the core. | The three files of this website stay as they are. |
| Remove everything that is not in the backup | Not ticked: files in the uploads and in the root folder and tables that are not in the backup are kept. | In the chosen roots, the restore removes what is not in the backup: files and, with the database, tables as well. What that means per root is explained below this table. |
| Leave out damaged entries (otherwise a damaged entry stops the restore) | Not ticked: a damaged entry ends the restore before the switch-over. | The restore continues without these entries only. It ends with warnings. |
| Leave out entries that cannot be created (otherwise such an entry stops the restore) | Not ticked: an entry that cannot be created in the build folder ends the restore before the switch-over. | The restore continues without these entries only. |
What the switch “Remove everything that is not in the backup” removes
The switch takes effect only in the roots that the restore restores, that is, in those that stayed ticked in step 2:
| Ticked root | What the switch removes there |
|---|---|
| Uploads | Files in the uploads that are not in the backup. |
| Root folder files (.htaccess, robots.txt, …) | Files in the root folder that are not in the backup. |
| Database | Tables of this website that are not in the backup. |
| Every other root | Nothing in addition. There, every restore moves whatever is not in the backup and was not excluded during the backup to the previous state. |
Nothing is deleted right away in the process. The files and tables are moved to the previous state: Undo restore brings them back; only Delete the way back deletes them permanently.
With the Database root, the switch removes tables
If Remove everything that is not in the backup is ticked and Database belongs to the scope, the restore also removes tables of this website, for example tables that a plugin created only after the backup. If you keep the restore, or if the plugin keeps it on its own after 7 days, these tables are deleted.
Before the start, the pre-check lists the tables that the switch would remove: The restore precheck: every point explained.
The switch does not remove the wp-config.php, anything that was excluded during the backup, for example caches, or any file that the restore itself leaves out: if Do not restore .htaccess, web.config, .user.ini is ticked, these three files stay where they are. All details about the switch are here: The “Restore” page. If the restore replaces the uploads in place, the switch is off: Restore uploads when there is not enough space.
Step 4: Read the pre-check
After every change to roots or switches, the pre-check runs again on its own. While it runs, Start restore is disabled. Run pre-check repeats it by hand.
- The duration of the pre-check and the target from which the plugin reads the backup.
- A point of the pre-check: coloured dot, name, state and finding.
- Not restored: lists what the restore leaves out, and in brackets the reason.
- Start restore
The pre-check checks only what you have chosen. Without the Database root, the three points about the database count as OK. The reasons in the list Not restored:
| Reason | Meaning |
|---|---|
| never restored | Appears next to this plugin. The restore never restores the plugin itself. |
| WordPress core not chosen | The switch Do not restore WordPress core is ticked. |
| left out by your choice | You set the switch for a backup of this website. |
| left out on a different website by default | The backup comes from a different website or is of unknown origin. |
Step 5: Start the restore
Click Start restore and read the confirmation dialog. If Remove everything that is not in the backup is ticked, the confirmation dialog repeats this choice in yellow. After that, the restore runs as with a whole backup: Restore the website from a backup. Without the database, the step Importing database is skipped. Without files, the second step is called Fetching parts.
Good to know
- A restore of parts also has a rollback: the previous state of the chosen roots is kept for 7 days.
- If you restore uploads or files in the root folder and there are executable files there that are not in the backup, for example PHP files, the restore ends with warnings. The log shows their number.
- A table that you back up as structure only is kept with its data during the restore of the database. If it does not exist on the website, the plugin creates it empty.
See also
- The restore precheck: every point explained
- Keep or undo a restore
- Define what gets backed up
- The “Restore” page
- Restore and import with WP-CLI
On the command line
WP-CLI not set up yet? How to install WP-CLI.
With WP-CLI you specify the roots in the parameter --roots, separated by commas. Without the parameter, the command restores every root of the backup. The parameter --remove-extras is the switch Remove everything that is not in the backup: it too takes effect only in the roots that the command restores.
# Restore only the database wp cloneworx-backup restore run <Job> --roots=db # Restore only plugins and themes wp cloneworx-backup restore run <Job> --roots=wp-plugins,wp-themes # Only uploads; what is not in the backup goes to the previous state wp cloneworx-backup restore run <Job> --roots=wp-uploads --remove-extras # Skip damaged entries wp cloneworx-backup restore run <Job> --accept-damaged # Leave out entries that cannot be created wp cloneworx-backup restore run <Job> --accept-failed