This is how you set up a folder on the server of your website as a target for your backups: from the folder browser via the connection test to the saved target.
What you need
- a folder on the server that the web server may write to,
- preferably a folder outside the website.
A local folder has no credentials.
Step 1: Choose the target type
Open the Targets page and click Add target. Choose Local folder.
- The target types that exist. Local folder is the first and carries the icon of a hard disk.
- Dismiss closes the selection.
Step 2: Choose the folder
The form opens with the folder browser. It starts in the home directory, the directory above the website. Backups there are usually not reachable from the web. But that is not necessarily so. If in doubt, check with your hosting provider or administrator! If PHP may not read the home directory, the folder browser starts in the uploads directory.
- Name is your name for the target. The plugin suggests “Local folder 1”; any name that is not yet taken works.
- Folder on the server is the absolute path of the folder. The field is required. The plugin enters the folder in which the folder browser starts.
- Browse opens and closes the folder browser.
- The entry points Home directory and Uploads directory jump to these folders. Below them is the path of the shown folder; a click on a part of the path opens that folder.
- The list shows the subfolders of the shown folder. A click opens the folder. Parent folder leads one level up.
- Use this folder enters the shown folder in the field and closes the folder browser.
- New folder creates a folder in the shown folder.
- Save saves the target and tests the connection immediately.
- Test connection checks the entered folder without saving.
In the folder browser, go to the folder you want and click Use this folder. You can also write the path into the field by hand. If you save right away, the backups are stored in the folder in which the folder browser starts.
The folder browser shows only what PHP may read on your server. On the right of the row there is a label if something special applies to the folder:
| Label | Meaning |
|---|---|
| not writable | The web server may not write to this folder. If you open it, Use this folder is locked, and New folder is missing. |
| inside the website | The folder lies in the root folder of WordPress or below it, for example in the uploads directory. |
| greyed out | PHP may not read the folder. It cannot be opened. |
Hidden folders whose name begins with a dot, and the plugin’s own folders, are not shown in the list. If a folder has more than 500 subfolders, the list shows only 500 of them and points this out.
Creating a new folder
Click New folder, enter a name and click Create. The folder browser changes into the new folder. With Use this folder you take it over into the field.
- Name of the new folder appears in the empty field for the name.
- Create creates the folder in the shown folder.
A name must not contain a slash and must not begin with a dot or with “cloneworx-backup”. Otherwise the field reports This name is not allowed. If the folder already exists, it reports A folder with this name already exists.
You do not create the folder of the plugin yourself. The folder browser says about this: The plugin creates its own backup folder inside the folder you choose.
A folder inside the website
If you open a folder inside the website, the folder browser warns above the list.
- Uploads directory is the entry point chosen here. The folder browser shows the uploads directory.
- The warning is above the path and the list, because the shown folder lies inside the website.
- inside the website appears on the right in the row of a subfolder that lies inside the website.
- Use this folder takes over a folder inside the website only after a confirmation dialog.
Use this folder then asks before it takes over the folder. The confirmation dialog is called Folder inside the website.
- Cancel closes the confirmation dialog. The folder browser stays open.
- Use it anyway enters the folder in the field.
The confirmation dialog names the risk: This folder lies inside the website. Backups there can be reached from the web if the folder protection fails. Technically possible, but not recommended: better choose a folder outside, for example in the home directory.
After Use it anyway, the warning stays below the field as long as this folder is entered. In the list of targets, inside the website appears after the location of such a target.
Backups inside the website are lost together with it
If all your targets are usable but all of them lie inside the website, the status tile of the Targets page is grey instead of green and reports All targets lie inside the website. Then add a target outside the website or on another server.
Step 3: Test the connection
Click Test connection. The plugin puts a small file into the folder, reads it back, compares it and deletes it again. If the test succeeds, this appears in green above the buttons of the form: Connection works: a test file was written, read back and deleted.
- Folder on the server contains the folder that the test checked.
- The result of the test appears in green above the buttons.
- Save saves the target (step 4).
Step 4: Save
Click Save. The plugin saves the target, tests the connection once more and reports the result. A target is usable only after a successful test.
- All targets are connected. appears in the green status tile when every target has passed its test and not all targets lie inside the website.
- The message names the target: saved and connected.
- The new target is in the list. The green dot means: connected. In front of the name is the icon of a hard disk.
After saving and the successful test, the plugin looks into the chosen folder. If it finds the folder of another installation there, or its own backups that are not in the list, the tile Backups found at “…” appears. More on 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.
If something does not work
If the plugin rejects a value, the message appears in red at the field. If the connection test fails, the reason is above the buttons, and Show log opens the general log with the details.
| Message | What you can do |
|---|---|
| This field is required. | Enter a folder. The plugin does not accept an empty field. |
| The folder does not exist, or the path is not absolute. | Enter the full path, from the top directory of the server on, or choose the folder in the folder browser. The message also appears if PHP may not reach the folder. |
| The folder is not writable. | Choose a folder that the web server may write to, or change the permissions of the folder on the server. |
| The folder lies inside the plugin directory, which WordPress deletes on every update. | Choose a folder outside the plugin directory. |
| This name is already in use. | Give the target a different name. The plugin does not distinguish between upper and lower case here, and removed targets also keep their name. |
| The folder could not be written or read. | Open the log with Show log and check the permissions of the folder on the server. |
Good to know
- The backups are stored under
<folder>/cloneworx-backup-<code>/<backup>/. Only your installation has the code. - In its folders, the plugin puts small protection files:
index.php,index.html,.htaccessandweb.config. - The connection test already creates the folder of the plugin in the chosen folder. It stays there even if you choose a different folder afterwards.
- You download backups at a local target in the browser: Download a backup.
- A mounted network storage is also a local folder for the plugin.
- A local folder is a target like any other: you can rename and remove it. You also do not need one if your backups go to a different target.
See also
- Which target suits you?
- The “Targets” page
- Schedule backups automatically
- Remove a target
- Manage targets with WP-CLI
On the command line
WP-CLI not set up yet? How to install WP-CLI.
A local folder has no secret values. So you can set it up entirely on the command line. You name the folder with --set-path; --path is a parameter of WP-CLI itself. After creating it, the target is not tested yet: only the test makes it usable.
# Create a local folder as a target wp cloneworx-backup target add local --name="Archiv" --set-path=/var/backups # Show targets with ID and state wp cloneworx-backup target list # Test the connection wp cloneworx-backup target test local-1 # Rename the target wp cloneworx-backup target edit local-1 --name="Archiv 2"