How to backup WordPress to OneDrive

In this post, we explain how to connect your Microsoft OneDrive cloud storage to BackWPup, and we also give an example of how to perform a backup to OneDrive.

Application Registration

To save a backup of your WordPress site to OneDrive, you first need a working OneDrive Application.

First, log in on the Microsoft Azure Portal.

If you don’t have a Microsoft Account you will be prompted to create a new account.

Once you are logged in to the Microsoft Azure Portal, register your Application using the available links, as shown in the figure below.

Microsoft Azure Portal with links to register an Application
Use the available links to access the Application registration section in the Microsoft Azure Portal

This will take you to the registration page: fill in the requested data and get an Application ID to represent your application in API calls.

Please note: make sure you choose an option that uses the Microsoft personal account as indicated in the figure below.

Microsoft Azure Portal: fill in the registration form fields to get the registration ID.

After registration, you can find the Client ID in the Application Overview:

ClientID in the application Overview
Get the Application Client ID value

The next step is to create the client secret to connect BackWPup to OneDrive.

On the Application page created in the previous steps, go to Certificates & Secrets and click on the New Client Secret key.

A form will open: Enter the required values and create the client secret.

Create the client secret
Create the client secret

Set Up the API Key and Redirect the URL

In your WordPress backend, go to the BackWPup Settings → API Keys tab and add the Client ID and client secret of the OneDrive Application under OneDrive API Keys.

OneDrive APi Key settings
Setting Up the OneDrive API Key in BackWPup

Next, copy the Redirect URL in the same area as shown in the image below.

Redirect URI detail
Copy Redirect URL in your BackWPup settings

Then, paste it to your OneDrive Application in Microsoft Azure, by going to the Authentication link on the left menu, and then into the Redirect URL section:

Set the Redirect URI in the Microsoft Azure page
Set the Redirect URI in the Microsoft Azure page

Run a Job in BackWPup: Create the Backup Archive in OneDrive

The Application has been properly set in the previous sections, let’s create a new job: select Backup to Microsoft OneDrive from the Job Destination options and save the job.

OneDrive destination option
Select the OneDrive destination option in BackWPup

Then, head to the To: OneDrive tab, and in the Login, click the Reauthenticate button.

Authenticate button for OneDrive
Reauthenticate the OneDrive connection

A message will appear that the plugin has now been authenticated.

OneDrive connection authenticated
OneDrive connection authenticated

Finally, you have a job ready to be executed! To run it, go into the Jobs screen and click Run now.

Run Now link to start the Job
Run the OneDrive backup job

When the job completes successfully, you should see the correctly uploaded backup archive file in your OneDrive app: Backup Archive to OneDrive.

Back up archive file stored in OneDrive
Check if the created backup archive is available in OneDrive.