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:
- Log in to your Google account.
- Visit https://console.developers.google.com/apis/library.
- Create a new project and select it.
- Activate the Google Drive API for this project.
- 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.
On the next screen, select the External option:
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:
- 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.
- In your WordPress admin area, go to BackWPup → Settings → API Keys, and go to the Google API Keys section.
- Copy the displayed URL under Redirect URIs and paste it into the Authorized redirect URI field in the Google Drive form.
- Then click on Create.
- After that, the client will be created, and you will be shown the client ID and client secret.
- 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.
- 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.
- Now you can see a new tab To: GDrive. Click on the tab.
- Click on Reauthenticate to authenticate BackWPup in Google Drive.
- You are redirected to Google and have to allow BackWPup access to Google Drive. Click on Allow.
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.
- 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.
- 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.