This is how you set up a WebDAV server as a target for your backups, for example Nextcloud, ownCloud or a NAS: from the form through the connection test to the saved target.
What you need
- the address of the folder on the server, starting with https://,
- user name and password; if the account uses two-factor authentication, an app password,
- a folder that nobody can reach without authorization, not even via a share link.
WebDAV is file access over HTTP. The plugin speaks WebDAV through the PHP extension cURL and reads the responses of the server with the PHP extension DOM.
Step 1: Choose the target type
Open the Targets page and click Add target. Choose WebDAV.
- The target types that exist. WebDAV carries the globe.
- Dismiss closes the selection.
If the web server lacks cURL or DOM, WebDAV is greyed out and carries the label Not available on this server. The reason is shown below the selection.
Step 2: Fill in the form
- Name is up to you. The plugin suggests “WebDAV 1”; any name that is not in use yet works.
- Address of the folder is the complete WebDAV address. The plugin creates missing folders.
- User name
- Password is the password of the account or an app password.
- Test connection checks the entered values without saving.
Fields with a red star are required. For the address:
- With Nextcloud and ownCloud it has the form
https://<server>/remote.php/dav/files/<user>/<folder>/. - User name and password belong in their fields, not in the address. The form rejects an address with credentials, a question mark or a hash sign: This value is not valid.
- The plugin accepts an address with http://. Password and data then travel in clear text.
The folder must not be publicly reachable
Make sure that nobody can access the folder without authorization, for example via a share link. The plugin never sends test requests to third-party servers. That is why it cannot tell you whether the folder is public.
Step 3: Test the connection
Click Test connection. The test logs in to the server, writes a small file, asks for its size, renames it, reads it back, lists the folder and deletes the file again. With a test file of 1 MiB it measures the upload rate.
- The result of the test: the connection works, a test file was written, read back and deleted.
- The upload method the test determined, and the measured upload rate.
WebDAV itself has no way to continue an interrupted upload. The plugin knows three methods. The test determines which one your server offers:
| Line in the result | Meaning |
|---|---|
| Upload method: the server continues an interrupted upload where it stopped. | The server accepts a part of a file at a given position, for example Apache with mod_dav. The method is called range. |
| Upload method: sections, as Nextcloud and ownCloud offer them. | The sections go into an upload folder of the server, which assembles them at the end. This only works with an address of the form …/remote.php/dav/files/<user>/…. The method is called chunks. |
| Upload method: every file in one request, because the server cannot continue an upload. | For servers that offer neither of the other two. The method is called whole. Below it you see how large the parts of a backup become at most. |
The last line names the rate: Measured upload rate: … per second.
Step 4: Save
Click Save. The plugin saves the target, tests the connection once more and reports the result: “…” saved and connected. Plans and backups use a target only after a successful connection test.
- All targets are connected.
- The message names the target: saved and connected.
- The new target is in the list. The green dot means: connected. A target of the type WebDAV is preceded by the globe.
If the plugin finds backups at the location of the target that are not in your list, the tile Backups found at “…” appears. More about this: Find backups again after a total loss.
Step 5: Choose the target in the backup plan
- Your first target: The plugin creates the plan “Daily backup”: daily at a random time, everything, this target, Max. backups 7. The plan is paused until you switch it on.
- Another target: Choose it on the Backup page in the tile Backup plans in a plan. The free version allows two plans and one target per plan.
More about this: Schedule backups automatically.
The fields of the Extended view
- Connection timeout (seconds) takes 3 to 60, the default is 10.
-
Upload method may stay empty: then what the connection test determined applies. Possible values are
range,chunksandwhole. - Upload rate (bytes per second) may stay empty: then what the connection test measured applies.
- Accepted key of the server is set by Accept this certificate. Empty means: the plugin checks the certificate against the list of trusted authorities.
An empty field whose value the test determines shows automatic. Every connection test determines method and rate anew. The backups keep both up to date: a smaller rate applies at once, a larger one by half. What you enter yourself always takes precedence.
Encryption and certificate
https:// is the rule. With http:// the result of the connection test warns: The connection is not encrypted: password and data can be read on the way.
With https:// the plugin checks the certificate of the server against the list of trusted authorities that comes with WordPress, together with the name of the server. If the check fails, the test fails and shows the certificate.
- The reason: not issued for this server name, self-signed, from an unknown authority or expired.
- The details of the certificate: who it is issued for, by whom, until when it is valid, and its fingerprint.
- Accept this certificate takes the key of the certificate into the form and tests again.
Above the reason 1 the picture shows the line Message from cURL with the original error message from cURL.
Accept only if the fingerprint matches
After accepting, the plugin trusts exactly this key and no longer checks who issued the certificate. Nobody has confirmed that this is the right server: compare the fingerprint with the one your provider names.
After accepting, the result of a successful test contains the warning: The certificate is not checked against the list of trusted authorities; the plugin trusts the key you accepted.
The check is never switched off. If the server later shows a different key, the target no longer passes its test: The server shows a different key than the one you accepted. It may have a new certificate, or someone may be in between. Accept the new certificate only if you know why it has changed.
When the test fails
If the test fails, the result is shown below the fields of the form. In the picture the server refused the login.
- The cause in plain language. The link at the end, Show log, opens the general log. The details of the test are there.
- Message from the target is the original error message of the WebDAV server.
If cURL reported something too, Message from cURL is shown below it. The error messages in both lines are not translated; credentials, folders and server names are masked in them.
| Message | What you can do |
|---|---|
| The target cannot be reached. Check the server name and the port; the host of this website may block the port. | Check the Address of the folder: the name of the server and, if it names one, the port. |
| The target refused the login. Check user name and password. | Enter the credentials again. If the account uses two-factor authentication, create an app password there and enter it. |
| The certificate of the target did not pass the check. | See the section “Encryption and certificate”. |
| The target redirects to another address. The plugin does not follow a redirect; test the connection of the target to see the new address. | See the next section. |
| The target does not allow everything the plugin needs. | Below the message you see what is missing, for example renaming or reading from a position. The plugin needs it to check, continue and clean up backups. Without this capability the target is not usable. |
| The target asked for a pause: it is busy, or it received too many requests. | Test the connection again later. |
| The target reports that there is no space left. | Free up space on the server, or choose a folder with more space. |
| The target refused the request, or the transfer failed. | If the plugin knows the reason, it is shown below the message: The target refuses uploads of this size. The limit is set at the target. Or: Another program has reserved this file at the server (WebDAV lock). Otherwise the line Message from the target helps. |
When the server redirects
The plugin does not follow a redirect, because the password would otherwise go to an address you did not enter. The test fails, and the new address is shown below the message.
- The message: the target redirects to another address.
- The new address the server redirects to.
Enter the new address as Address of the folder if it is the right one.
When an upload is too slow
The plugin works in short steps. With the method whole every file has to arrive within one step. That is why the plugin splits a backup to such a target into smaller parts: it calculates with the upload rate of the target and the maximum time of a step and chooses a size between 1 MiB and 256 MiB. The result of the connection test names it: A backup that goes to this target is therefore split into parts of at most …, at every target of that backup.
- The result of the test: the connection works.
- The upload method the test determined: every file in one request.
- The maximum size of the parts of a backup that goes to this target.
If a file still does not arrive in time, the target counts as failed in this backup after three attempts. The message for it: An upload did not arrive before the time of a step ran out: the connection to the target is too slow for it. The plugin then remembers a smaller rate, and the next backup gets smaller parts. Test the connection of the target again to measure the rate anew. How long a step takes at most is set by the setting Maximum time per step: Adapt the plugin to your server.
Good to know
- The backups are stored on the server under
<Adresse>/cloneworx-backup-<code>/<backup>/. You do not have to create the folder of the plugin. - In its folders the plugin places the protection files
index.phpandindex.html, but neither.htaccessnorweb.config: a WebDAV server reads the files that are stored with it. At a WebDAV target the login at the server protects the folder. - If the server asks for a pause during a backup, the plugin waits as long as the server says, at most five minutes, and then tries again.
- The plugin deletes files one by one. It removes a folder only if the server lists it as empty.
- Backups that are stored only at a WebDAV target you do not download through the plugin, but with your WebDAV program or in the web interface of the server. Restore, check and finding backups read directly from the server.
- If the server names the free space, the plugin checks before writing a backup whether it is enough. The tile Targets and space in the Extended view shows the free space only for local folders; for a WebDAV target it shows a dash.
- The plugin also uses a proxy from the
wp-config.phpfor WebDAV.
See also
- Which target suits you?
- The “Targets” page
- Renew the credentials of a target
- Check backups at a target and clean up leftovers
- When a backup fails or ends with warnings
On the command line
WP-CLI not set up yet? How to install WP-CLI.
The command line does not accept the password; that is why you set up a WebDAV target on the Targets page. Everything else also works with WP-CLI:
# Show targets with ID and state wp cloneworx-backup target list # Test the connection wp cloneworx-backup target test webdav-1 # Create a backup plan that backs up to this target wp cloneworx-backup plan add --targets=webdav-1 --rhythm=daily --time=03:15 --name="Nachts" # Check the backups at this target wp cloneworx-backup target check webdav-1 # Show leftovers (--dry-run) and clean up wp cloneworx-backup target cleanup webdav-1 --dry-run wp cloneworx-backup target cleanup webdav-1