How to add S3 services programmatically

How to add S3 services programmatically

How to add S3 services programmatically
Starting from BackWPup version 3.6.10 is possible to add new S3 services to the default list through the filter hook backwpup_s3_destination.
Every service we need to add can be set via an array that specifies the label, the region and the url of the service we want to add.
Here below we set an example:
add_filter( 'backwpup_s3_destination', function ( $destinations ) {
return array_merge( array(array(
'label' => __( 'FirstServiceTest: AMS3', 'backwpup' ),
'region' => 'ams3',
'base_url' => 'https://example.com',
),
array(
'label' => __( 'SecondServiceTest: AMS', 'backwpup' ),
'region' => 'nl-ams',
'base_url' => 'https://example.com',
)
), $destinations );
} );
In this example we set two arrays, one for the FirstServiceTest and a second one for the SecondServiceTest.
These new services now will be available in the S3 service list for the related jobs.

File size cannot be retrieved. File might be too large…

File size cannot be retrieved. File might be too large…

File size cannot be retrieved. File might be too large…
If BackWPup displays the message
File size of 「%s」 cannot be retrieved. File might be too large and will not be added to queue.

then the backup folder contains a file that is too large for backing up.
Note: This error message points toward your server running with 32 bit PHP. Please upgrade PHP to the 64 bit version if possible. Contact your hosting provider for assistance. An upgrade to 64 bit should take care of the above problem.
With 32 bit PHP, files larger than 200 MB can cause a backup failure every time. Your other option – if you can』t upgrade to 64 bit PHP – is to either delete the file if it is no longer needed or to simply exclude it from the backup.
To exclude a file from your backup, go to BackWPup → Jobs via the backend, select the relevant job and click the Files tab. There you will find various options for excluding files.
Important: The tab 「Files」 will only be visible if you have previously indicated a backup of the files in the tab 「General」.

The tab 「Files」 will only be visible if you have previously indicated a backup of the files in the tab 「General」.

Why a BackWPup Restore stand-alone App?

Why a BackWPup Restore stand-alone App?

Why a BackWPup Restore stand-alone App?
This article explains why we decided to build a BackWPup restore stand-alone app besides to an integration into BackWPup. We discussed this in our team and finally settled with this decision because of vary reasons.

The worst-case is covered
Imagine the worst-case: Your WordPress site does not show anything. We call that 「White-Screen of Death」. If your not able to log in to see the backend, you』re not able to use a restore feature within BackWPup. Using a stand-alone app can help in this situation.

Easier to develop such a new feature
This is our first attempt to build a restore feature and we』re as excited as you. However, developing such a new feature is not always easy. Using a stand-alone app in the beginning helps us to get familiar with the topic and discover general pitfalls.

Decouple Logic and View
Ok, let me explain that. We build this stand-alone app in such a way, that we can reuse parts of it later in BackWPup Pro. So that means, the code, which is responsible for restoring a backup is not only build for this app but also for the plugin later. So we won』t have to rebuild everything in the near future when integrating it into BackWPup. We decouple the part, which handles the restoration from the part, which shows the GUI (Graphical User Interface) in browsers.

Learn how to install the BackWPup restore stand-alone app.

Install BackWPup Restore stand-alone App

Install BackWPup Restore stand-alone App

Install BackWPup Restore stand-alone App
This article shows how to install the stand-alone restore app. We created this BackWPup Restore stand-alone app out of several reasons. For example in case your whole WordPress installation isn』t available anymore and you want to restore.

To install the BackWPup restore stand-alone app, you will need

FTP access to your web server

Table of Contents

InstallationTroubleshootingStartUp script forwards but I see only a white page
1. Installation

Download BackWPup Pro in your account and extract the zip-file. Now you have a folder backwpup-pro. This folder contains another zip-file backwpup-restore-app-xxx.zip
Extract the zip-file backwpup-restore-app-xxx.zip.
You will find two files in the folder,restore.phar and StartUp.php. Upload these two files to your web server. You can use a FTP Client of your choice to upload the files. The files should be placed in the same folder as your WordPress installation. I.e. restore.phar and StartUp.php should be in the same folder like wp-config.php and wp-content/.
Now we can start the restore app. Let』s assume your WordPress site is available at http://example.com/. Go to http://example.com/StartUp.php. The startup script will extract all necessary files and forward you to the restore app. The app looks like the following.

You are now ready to use the restore app. Simply upload your backup and follow the described steps. Check out the article how do I use the BackWPup restore feature to get more information.

2. Troubleshooting
2.1. StartUp script forwards but I see only a white page
This can happen in different situations:
The startup script might not be able to unpack restore.phar correctly. Take a look into the directory where StartUp.php and restore.phar are localized. Is there also a new restore/ folder? If no, then the script was not able to unpack the app correctly.
Make sure that both files have the following file permissions: 644.
If the startup script was able to create a restore/ folder, take a look into it and see if there exists a file in restore/src/App/index.php.

My backup jobs don』t seem to run as scheduled

My backup jobs don』t seem to run as scheduled

My backup jobs don』t seem to run as scheduled
BackWPup uses the WordPress Cronjob system (WordPress Cron), to execute scheduled backup jobs. WordPress has no internal clock, so it checks the server time regularly and runs activities that are due. This happens every time someone (or yourself) is browsing your website.
If no one visits your website for some time, it can lead to some trouble with the Cron. In this case, a Cron job on the server needs to be set up, which regularly calls the URL http://yourdomain.com/wp-cron.php.
You can find out easily if the WordPress Cron is working correctly:

Create a new post and set the publish date in the future. 10 Minutes are enough.
Log out of WordPress and close your browser window (this is important!).
After 11 or more minutes, check if your post was published. If not, something is wrong with the WordPress Cron.

If you encounter problems with starting backup jobs via WordPress Cron, the setting option Start job with EasyCron.com can be considered. Then you don』t need traffic on your website to start the backup jobs at the desired time.
EasyCron is especially helpful, if your webhost does not allow loopback connections or does not offer Cron jobs on the server side.
Start job with EasyCron

Sending in log files for the support

Sending in log files for the support

Sending in log files for the support
If our support has asked you to send in log files, please read through this document how to do this. It is important for our support to review the so called debug log files. First, you have to set the Logging Level under Settings -> Logs to 「Debug (not translated)」. We can only offer support in German or English, so the log files should not be translated.

Debug log: not translated

Second, you need to start the job again that you have trouble with. This time, a more comprehensive log file is generated. Now you can download the log file under BackWPup -> Logs.

Download the log file under BackWPup Logs

You need to send this log file via email or via the Support form to our support.
IMPORTANT: Set the logging level back to 「Normal」 once the problem has been solved.

Error: Cannot create folder

Error: Cannot create folder

Error: Cannot create folder
BackWPup writes files and directories to your webspace and requires specific rights to do so. Are these rights not assigned, then the following error message will be displayed:
Cannot create folder Parent directory/Subdirectory

whereby Subdirectory is the name of the directory to be created and Parent directory is the location where it will be created.
This is how you solve the problem:

Log in to your webspace via FTP. You will need to install an FTP client, e.g. Filezilla. Your hosting provider will give you the access information you need (server address, user name and password). Filezilla displays the files on your PC on the left and the files on your webspace on the right of the screen.
Navigate to the parent directory
On the FTP server, you can now navigate to the parent directory mentioned in the error message and create the required subdirectory there.
Click on the directory and right-click to open the context menu. The menu item File permissions is at the bottom of the list.
A separate window opens, where you enter 777 in the field Numeric value. This value is not necessarily perfect, but it serves a quick fix and should be cleared with your hosting provider in the long term. We can』t give you the exact value, as it depends on the settings of your server.
A separate window opens, where you enter 777 in the field Numeric value

Job restarts due to inactivity for more than 5 minutes

Job restarts due to inactivity for more than 5 minutes

Job restarts due to inactivity for more than 5 minutes
This error message appears when BackWPup notices that the job status has not changed for more than five minutes. This often happens if a monitoring process quits the backup script as it is running too long or uses too many resources.
Usually, this problem can be solved by setting the Maximum script execution time option under Settings → Jobs. BackWPup tries to restart the script before it reaches the maximum execution time. Its advantage is the definied restart, which prevents data failure in the backup files.
You may have to experiment with the Maximum script execution time until you found a good setting on your server. A value that frequently works is 25 seconds.
A value that frequently works is 25

Job has started, but not responded for 10 seconds

Job has started, but not responded for 10 seconds

Job has started, but not responded for 10 seconds
Everytime a backup job is started, BackWPup checks if the job was started within 10 seconds. If not, the following error message will be displayed:
Job „%s「 has started, but not responded for 10 seconds.
In this case go to BackWPup → Settings → Information. There you can find the entry Server self connect with more details, which are relevant to this error message.
If you don』t know what to do with this, copy all information on this page and contact the BackWPup Support. For the Free Version use the support forums on wordpress.org. If you have purchased the Pro Version, you can use the BackWPup Premium Support.
Server self connect

Table of Contents

Error messages and possible solutionsNot expected HTTP response: WP Http Error:  Failure when receiving data from the peerNot expected HTTP response: Status-Code: 500
1. Error messages and possible solutions
Here is a list of error messages, which can appear under Server Self connect.
1.1. Not expected HTTP response: WP Http Error:  Failure when receiving data from the peer
In this case your host is probably blocking the access to the wp-cron.php file. Please contact your host and check if this is the case and if it is possible to change. Apart from that you can try a workaround for BackWPup: Activate alternative Cron by adding the following line to your wp-config.php:
define( 'ALTERNATE_WP_CRON', true );

1.2. Not expected HTTP response: Status-Code: 500

Check if your blog is in maintenance mode. The maintenance mode blocks the plugin』s ability to access the WordPress files and folders.

I created a list of my plugins, but it』s hard to read

I created a list of my plugins, but it』s hard to read

I created a list of my plugins, but it』s hard to read
A backup with BackWPup cannot only consist of the WordPress filesystem and the database, but also a list of plugins (see BackWPup → Add a new job → General). If you haven』t created a full backup, you can tell which plugins were installed by exactly this list of plugins. After restoring your backup to your WordPress installation, you』re able to install all plugins now manually.
You can find the list of plugins in the folder of your backup in a file like BackWPup.pluginlist..txt.
When you open the file, in some cases there won』t be line breaks and that will make the list of plugins hard to read. Try to open the txt-file in a text editor like Notepad++ (Windows OS), TextMate (Mac OS) or Sublime (any OS). The result should look like on the following screenshot. The screenshot was made using Sublime.
BackWPup.pluginlist