On the Restore page you put a backup back onto this website: the database, the files or both. Here you choose the backup, read the pre-check, start the restore and afterwards decide whether you keep it or undo it.
Everything slow happens next to the running website. The switch-over itself takes a moment. Afterwards the previous state is kept for 7 days: for that long there is a rollback.
A restore replaces the current state
The backup replaces the current state of the chosen areas. The tables of the database come from the backup: whatever has been added to these tables since the backup is missing afterwards. Never restored are the plugin itself with its folders and tables and the file wp-config.php.
The page at a glance
- Restore is the menu item of the page, in the WordPress menu under cloneworx.
- The main tile names the last good backup. During a restore it shows the progress, afterwards the open rollback.
- Restore latest backup opens the tile Prepare restore with the last good backup.
- Import from file opens the tile for importing a backup file.
- Backups is the list of backups. On this page it is the selection for the restore.
- More … opens the menu of a backup.
- Show more appends the next 7 rows to the list.
- Extended switches to the view with all details. The choice applies to all pages of the plugin.
Below the main tile, when needed, the message of the page and one of the two tiles Prepare restore and Import from file appear. Only one of the two is ever open.
The main tile
The main tile knows three states:
| State | What the tile shows | Buttons |
|---|---|---|
| ready | Title Restore, below it Last good backup with date, size, targets and type. | Restore latest backup and Import from file |
| restore running | Title Restore is running, the step, a bar and the progress of the running phase. | Cancel, until the switch-over begins |
|
yellow rollback open |
Title Restore applied, when the restore was applied and until when it can be undone. | Keep restore and Undo restore |
- A good backup is one that is complete or complete with warnings. As the last good backup the tile names the newest good backup that is still stored completely at at least one target.
- If there is no such backup, the tile reads No good backup yet: nothing to restore. The button Restore latest backup is then missing.
- If another job is running right now, for example a backup, Restore latest backup is blocked. Only one job ever runs at the same time.
- For today, yesterday and tomorrow the main tile names the word instead of the date. The lists always name the full date.
- If the page cannot load the state, the message of the server stands in red in the main tile. If it cannot load the list, the message stands in red above the list.
The list of backups
- The line names the last good backup with date, size, target and type.
- Restore latest backup
- Import from file
- The header row sorts the list: a click on a column word sorts by this column, a second click reverses the direction. The triangle stands at the sorted column.
- The padlock marks a locked backup.
- The dot shows the result of the backup: green for complete, yellow for with warnings, red for failed.
- The green tick means: the last check found the backup readable and complete. A red cross means: damaged or incomplete.
- More … opens the menu of this row.
- Show more appends the next 7 rows.
The columns are called Date, Size, Targets and Type. The column Type reads Full if the backup ended complete or with warnings, otherwise the status: Failed, Aborted or Running. On opening, the newest backup is at the top.
- The list shows 7 rows. If more than 7 are shown, Show less leads back to the first 7.
- An aborted backup has a grey dot, a running one a spinning ring.
- If the list is empty, it reads No backups yet.
- If the list becomes too narrow, the column Plan gives way first, then the column Size.
- Lock and tick have a tooltip: it names their meaning when you point the mouse at them or tap them.
The menu of a backup
- Restore opens the tile Prepare restore with this backup.
- Lock backup protects the backup from automatic deletion. For a locked backup the entry is called Unlock backup.
- Log opens the log of the backup.
- Restore and Lock backup appear only for a good backup that is stored completely at at least one target. Every other backup has only Log.
- Checking, downloading and deleting are in the menu on the Backup page: The “Backup” page.
- As long as a restore is running or a rollback is open, Restore does not open the preparation. A new restore begins only once you have kept or undone the open one.
Prepare restore
Restore latest backup and the entry Restore in the menu open the same tile. The preparation does not change anything on the website yet.
- Dismiss closes the tile.
- Selected backup names date, size, targets and type of the backup.
- In the Compact view the scope is always the whole backup. The line names its content.
- Pre-check is the list of the nine points with their result. Run pre-check next to it repeats the pre-check by hand.
- Start restore opens the confirmation dialog. The button is blocked as long as the pre-check is running or a point blocks the start.
- Cancel closes the tile without changing anything.
After the scope and below the buttons stand two notes that apply to every restore: wp-config.php is never restored. and You will need to log in again afterwards.
Scope and switches in the Extended view
- The checkboxes show the roots of the backup. What is ticked is restored.
- wp-config.php is never restored.
- Do not restore WordPress core leaves out the WordPress core.
- Do not restore drop-ins (object-cache.php, advanced-cache.php, db.php) leaves out these three files.
- Do not restore .htaccess, web.config, .user.ini leaves out these three files.
- Move uploads that are not in the backup to the previous state moves files from the uploads that the backup does not contain to the previous state.
- Leave out damaged entries (otherwise a damaged entry stops the restore) restores the backup without its damaged entries.
A root is a named area of the website, for example the plugins or the uploads. The tile shows only the roots that are in this backup: Database, wp-content (everything else), Plugins, Themes, Must-use plugins, Uploads, WordPress core and Root folder files (.htaccess, robots.txt, …). If no checkbox is ticked, the whole backup applies. What is really restored is named by the confirmation dialog before the start.
| Switch | Default | Effect |
|---|---|---|
| Do not restore WordPress core | Same website: not ticked. Different website or unknown origin: ticked. | The core stays as it is on this website. If the backup does not contain the core, the switch is blocked. |
| Do not restore drop-ins (object-cache.php, advanced-cache.php, db.php) | As for the core. | The three files from the backup are left out. This website’s own drop-ins move from wp-content (everything else) to the previous state during the restore, like other entries there that do not come from the backup. |
| Do not restore .htaccess, web.config, .user.ini | As for the core. | The three files stay as they are on this website. |
| Move uploads that are not in the backup to the previous state | not ticked | By default, files in the uploads that are not in the backup stay where they are. If the switch is ticked, they move to the previous state and come back with Undo restore. Files in the root folder that are not in the backup always stay. |
| Leave out damaged entries (otherwise a damaged entry stops the restore) | not ticked | By default, a damaged entry ends the restore before the switch-over. If the switch is ticked, the restore continues without exactly these entries. If it has left out entries, it ends with warnings. |
Whether the backup comes from this or from another website is determined by the pre-check. The switches therefore always show what will happen: your choice, otherwise the default of the pre-check. Until the first pre-check has answered, a note stands in their place saying that the pre-check is running and determines the defaults.
For the backup of a different website, the first three switches are ticked after the pre-check:
- Do not restore WordPress core is ticked: the core stays the one of this website.
- Do not restore drop-ins (object-cache.php, advanced-cache.php, db.php) is ticked: the three files from the backup are left out.
- Do not restore .htaccess, web.config, .user.ini is ticked: the three files stay the ones of this website.
More on this: Restore a backup on another website.
The pre-check
The pre-check runs by itself as soon as the tile opens, and once more after every change to the scope or the switches. Before the restore writes anything, nine points are thus checked. Every point ends with one of four states: OK, Warning, Blocked or Not checked.
- A warning does not block the start: you judge the risk.
- If a point blocks, the list is followed by The pre-check blocks the start., and Start restore stays blocked.
- If there is not enough space to build the uploads next to the live folder, the block No way back appears: Restore uploads when there is not enough space.
Every point with its findings is explained in The restore precheck: every point explained.
The confirmation dialog
Start restore asks once before anything happens. The dialog window is called Start the restore?
- The text names the backup that is restored and the time limit: the previous state is kept for 7 days.
- The line names what is restored: database, files, WordPress core.
- You will need to log in again afterwards.
- Cancel closes the confirmation dialog. The preparation stays open.
- Start restore starts the restore.
- If at least one point of the pre-check warns, the confirmation dialog additionally reads … point(s) of the pre-check warn; you have judged the risk.
- If you have ticked Replace uploads in place anyway (cannot be undone), the confirmation dialog repeats this choice in red, and the button Start restore is red.
The restore is running
- The line names the step with number, number of steps and name, for example “Step 2 of 5: Building files”.
- The line names the running phase and its progress: entries, size and remaining time.
- Abort backup aborts a restore as well. The link is called the same here as for the backup.
- Cancel aborts the restore. The button is there until the switch-over begins.
Which steps a restore has depends on the scope:
| Step | What happens |
|---|---|
| Pre-check | The nine points run once more. If a point blocks, the restore ends before anything is written. |
| Building files | In every root folder the plugin creates its own folder and writes the files of the backup into it. A local target it reads in place. From a remote target it fetches one part after the other into its work folder, checks it and deletes it there again. If you restore only the database, the step is called Fetching parts. |
| Importing database | Only with the database. Every table of the backup is created under a provisional name next to the live tables and filled. If the database server reports an error, the plugin repeats the step after 5 and after 15 seconds. The third failure in a row ends the restore before anything is switched. |
| Switching over | The plugin counts the files in the uploads and in the root folder that are not in the backup, and switches uploads and root folder files file by file. Then follows the switch-over in the maintenance mode of WordPress: first all tables of the database at once, then core, must-use plugins, plugins, themes and the rest of wp-content. After that the new website confirms itself. |
| Confirming | The completion. With the database, one step runs in the new WordPress: the object cache is flushed, the permalinks are rewritten, the schedule of the plugin is set again. Then the plugin sets the permissions of the folders. |
- At the start, instead of the time it reads calculating the remaining time …
- After a click on Cancel the tile reads Abort requested; the backup stops at the next step. The restore stops at the next step, and the page reports Restore aborted; nothing was switched.
- The page keeps showing the progress, even if your login becomes invalid after the switch-over of the database. If you reload the page, it finds the running restore again.
Keep the page open
The open page helps drive the steps of the restore. After the switch-over it confirms the new website if the server cannot call itself.
The confirmation after the switch-over
- The line names the step “Switching over”. The button Cancel is gone: from the switch-over on, the restore can no longer be aborted. The link Abort backup is still there but has no effect from here on. Afterwards the restore can be undone.
- The new website is confirming itself; this page helps if the server cannot call itself.
After the switch-over the new website has to confirm itself. For this the plugin calls its own address. An answer comes only if WordPress, the plugins and the theme of the new state load. The open Restore page calls the same address, for servers that block requests to themselves.
- If the confirmation does not come within 60 seconds, the same step switches everything back. The website then runs on the previous state again within seconds, and the restore ends as failed.
- After the confirmation the plugin fetches the home page once. If it reports a fatal error, that is noted as a warning in the log. The restore stays, you decide.
The result
The result stands as a message below the main tile.
| Message | Meaning |
|---|---|
|
green Restore applied · You will need to log in again afterwards. |
The restore is applied. The message closes by itself after 8 seconds; the main tile shows the open rollback. |
|
yellow Restore applied · You will need to log in again afterwards. |
The restore is applied with warnings. The message stays until you close it. The warnings are in the log of the restore: in the Extended view in the tile Recent restores. |
|
yellow Restore aborted; nothing was switched. |
You aborted the restore before the switch-over. The website is unchanged. |
|
red Restore failed: … |
The message names the reason. Log after it opens the log of the restore. If the server rejects the start already, it is followed by Show log; the link opens the general log. |
The red message names these reasons:
| Reason | What it means |
|---|---|
| The pre-check blocked the start. | A point of the pre-check blocked in the first step. Nothing was written. Open the preparation once more and read the pre-check. |
| The backup has damaged entries; nothing was switched. | The log names the number of damaged entries and the first five. Take another backup, or choose Leave out damaged entries (otherwise a damaged entry stops the restore) in the Extended view. |
| The new website did not confirm itself in time; the previous state is back. | The new state could not be loaded, or the confirmation did not arrive. The website runs on the previous state. |
| The switch-over failed; the previous state is back. | The plugin reverted the switch-over. The website runs on the previous state. |
| Switching the database tables failed; nothing was switched. | The database server did not carry out the renaming of the tables. If other connections keep the tables busy, the plugin tries again after 5 and after 15 seconds; only the third failure ends the restore. The error of the database server is named in the log. |
| Importing the database failed three times; nothing was switched. | A step of the import failed three times in a row with an error of the database server, for example because the connection broke off. The provisional tables are removed again. |
| A part failed verification twice. | For the restore this means: a part that was fetched from the target does not match its checksum. Nothing was switched. Check the backup: Check a backup. |
| Nothing to restore. | Of the chosen roots, none remains that is restored. Check the scope and the switches. |
| A job is already running. | The server rejected the start: only one job ever runs at the same time. Wait until it has finished, then start the restore again. |
If the page knows no sentence for a reason, it reads Cause: … with an English code; the details are in the log. If reading from the target fails, the message additionally names the target and the unchanged message from the target. A failed and an undone restore send an email like a failed backup if On errors and warnings is switched on in the notifications.
The open rollback
- The line names when the restore was applied and until when it can be undone.
- The previous tables and folders are kept for 7 days. Keep the restore or undo it; after 7 days it is kept automatically.
- Keep restore removes the previous state: the previous tables and folders. After that there is no rollback any more.
- Undo restore brings the previous state back.
Both buttons start immediately, without a confirmation prompt. The work runs as a job; the main tile shows the progress, and both buttons are blocked meanwhile.
| Message | Meaning |
|---|---|
|
green Restore kept. The previous tables and folders were removed. |
The rollback is closed. The main tile is ready again. |
|
green Restore undone. The website runs on the previous state again. |
The previous state is back. The main tile is ready again. |
|
red That did not work: … |
The message names the reason. |
- If there were warnings while keeping or undoing, the same sentence stands in a yellow message.
- Both buttons also work after logging in again, as long as the rollback is open.
- After 7 days the plugin keeps the restore by itself.
- Uploads that were replaced in place have no rollback. Undo restore then brings back everything else; the uploads stay as the restore wrote them.
- The Overview page shows the open rollback as well, with the link Keep or undo it.
Step by step: Keep or undo a restore.
Import from file
Import from file opens a tile with an upload area, the button Choose file, the dropdown menu Import to target and the button Import. You choose the backup file (.tar) that this plugin downloaded and the target at which the backup is stored.
The upload runs in parts. Afterwards the plugin checks the backup, stores it at the chosen target and enters it into the list. From there you restore it like any other backup. Step by step: Import a backup from a file.
The Extended view
In the Extended view these are added:
- the column Plan in the list of backups,
- the roots and the switches in the tile Prepare restore,
- the tile Recent restores below the list.
- The column names what ran: Backup of … for the restore of this backup, otherwise Keep restore or Undo restore.
- The column names the state, for example Undo open, kept or reverted.
- Duration names how long the job ran.
- The arrow folds the tile open and closed. A click on the title row does the same.
- The dot shows the result: green for success, yellow for with warnings, red for failed or aborted.
- Log opens the log of this job.
| State | Meaning |
|---|---|
| Running | The job is still running. |
| confirmed | The restore is applied. The word is shown if nothing is noted about the rollback. |
| Undo open | The restore is applied, the previous state is still there. |
| kept | The restore was kept, the previous state is removed. |
| reverted | The restore was undone. The same word is shown for a restore that failed and whose switch-over the plugin reverted. |
| Failed | The job failed. |
| Aborted | The job was aborted. |
For a running and for an aborted restore, the column before it reads Undo restore instead of the backup.
The tile is collapsed when you open the page. Unfolded, it shows 7 rows, the newest first. Show more fetches 7 more each time, up to at most 100; Show less leads back. As long as no restore has ever run, it reads No restores yet.
The log
Log in the menu of a backup, in the tile Recent restores and after a red message opens the same dialog window. It shows the last 500 lines of the log, with time, level and message per line. Logs are in English. More on this: Progress, messages and log.
See also
- Restore the website from a backup
- The restore precheck: every point explained
- Restore only parts
- Restore a backup on another website
- Restore and import with WP-CLI
On the command line
WP-CLI not set up yet? How to install WP-CLI.
Pre-check, restore, keeping, undoing and import also work with WP-CLI. You name a backup by its job name; the job names are shown by backup list. The switch-over itself the command hands over to the web server, because the new website confirms itself there.
# Show the backups with their job names wp cloneworx-backup backup list # Run the pre-check for a backup wp cloneworx-backup restore precheck <Job> # Restore the whole backup wp cloneworx-backup restore run <Job> # Restore only the database wp cloneworx-backup restore run <Job> --roots=db # Show the running restore or the pending rollback wp cloneworx-backup restore status # Keep the restore: the previous state is removed wp cloneworx-backup restore keep # Undo the restore: the previous state comes back wp cloneworx-backup restore undo # Import a backup from a file to a target wp cloneworx-backup import /tmp/backup.tar --target=local-1