How to backup WordPress to Google Drive

Check out the benefits of a WordPress Backup to Google Drive.

This is a BackWPup Pro feature. Learn more about it and purchase BackWPup Pro to unlock it. You first need a Google account to save your WordPress backup to Google Drive with BackWPup. You can find instructions on how to create one here.

Then you need to set up Google Drive authentication for BackWPup. To do this, follow these steps:

    1. Log in to your Google account.
    2. Visit https://console.developers.google.com/apis/library.
    3. Create a new project and select it.
      Create a new project and select it
      Create a new project

      Create project
      Create project
    4. Activate the Google Drive API for this project.
      Activate the Google Drive API for this project
      Activate the Google Drive API for this project

      Enable Google Drive API
      Enable Google Drive API
    5. Click on Credentials in the sidebar, and if a consent screen configuration is requested because it has not been set before (as in the image below), click CONFIGURE CONSENT SCREEN.
      Click on CONFIGURE CONSENT SCREEN if no consent screen is set

      On the next screen, select the External option:

      Select the external option for the User Type

      Finally, set an application name, your google account for email support, and your email address at the bottom for Developer contact in the next screen.

      Now, you can complete the process by pressing the Save button on the following screens until you get back to the Dashboard.

      After these settings, authentication is set in test mode by default: To put it to production when you need to use the app in production mode, select the link to the OAuth approval screen in the left menu and click PUBLISH APP.

      Working in test mode restricts access to Google Drive, making the authentication process more limited. See the image below:

      Select the OAuth consent screen link in the left menu and then click on PUBLISH APP
    6. Once the consent screen is set, click on the Credentials link in the main dashboard and then click on the + CREATE LOGIN DATA link and select OAuth Client ID. 
      Click on the Credentials link, and then click on the link + CREATE CREDENTIALS and select OAuth client ID

      You will be redirected to a new page. Under Application Type, select Web Application and enter a name for the web application. Leave the Authorized JavaScript Sources field empty. You need to go to your WordPress dashboard (see next step).

      Set the Web Application
    7. In your WordPress admin area, go to BackWPup → Settings → API Keys, and go to the Google API Keys section.

      BackWPup → Settings → API Keys and there to the section Google API Keys
      BackWPup → Settings → API Keys and there to the section Google API Keys
    8. Copy the displayed URL under Redirect URIs and paste it into the Authorized redirect URI field in the Google Drive form.
    9. Then click on Create.
    10. After that, the client will be created, and you will be shown the client ID and client secret.

      Client ID and Client Secret form
    11. Copy the Google Drive Client ID and Secret and paste them into the BackWPup backend in the field Client ID and Client Secret. Then, save the BackWPup settings.
    12. Edit the desired backup job and choose Google Drive as the backup destination. Or create a new job: BackWPup → Add new job → General, section Job Destination.

      BackWPup → Add new job → General, section Job Destination
      BackWPup → Add new job → General, section Job Destination
    13. Now you can see a new tab To: GDrive. Click on the tab.

      GDrive. Click on the tab
      GDrive. Click on the tab
    14. Click on Reauthenticate to authenticate BackWPup in Google Drive.
    15. You are redirected to Google and have to allow BackWPup access to Google Drive. Click on Allow.
      BackWPup access to Google Drive
      BackWPup access to Google Drive

      After this, you will be redirected to your WordPress admin area, where you should see the successful authentication.

      Note: When setting up multiple WordPress backup jobs to Google Drive, you may encounter authentication issues. Instead of creating a new job, try to copy the first Google Drive job and modify it accordingly. This way, you avoid the authentication process.

  1. On the settings page, there are some more options:
    • Folder in Google Drive: Name of the folder, where all backups will be stored.
    • File Deletion: The maximum number of backups to be stored. Older backups will be deleted.
    • Checkbox below File Deletion: Pushes the old backups to the Google Drive trash instead of deleting them immediately.
  2. Test the correct Google Drive authentication by starting a backup job with this destination. You should now see your backup on Google Drive if it was successful.

    You should see your backup in Google Drive
    You should see your backup in Google Drive