WordPress is a popular blogging platform and content management system used by many bloggers and organizations around the world. While using WordPress, it is essential to regularly backup your website contents so that if there is any issue with your servers or hardware, or some of your data gets corrupted or lost, it can be easily recovered. There are many cloud-based services to backup WordPress website. Some website administrators even backup WordPress to GitHub, a cloud-based service to host source code and data. There are many plugins to help you with this. In this article, we will learn how to backup WordPress to GitHub.
How to Backup WordPress to GitHub
Here are the steps to Backup WordPress to GitHub.
1. Create GitHub Account
If you already have a GitHub account, you can skip this step. Otherwise, go to GitHub and create new account.
Once you have created a new account, sign in to it.
2. Create New Repository
After you have logged in, click +button icon on top right corner and click New Repository in its dropdown menu.
You will see a form that asks for you for some details required to create new repository – repository name, description, public or private, etc. Enter details as required, enable ‘Initialize with README’ and click Create Repository.
3. Install WordPress Plugin
Next, go to your WordPress Admin’s Plugin->Add New page. Search for ‘github sync’. Install and Activate the plugin named ‘WordPress GitHub Sync’ plugin.
4. Configure WordPress Plugin
Next, go to Settings->GitHub Sync to configure the plugin.
You will see a form that asks for details about the GitHub repository where you want the backup to be stored.
Enter GitHub Hostname as https://api.github.com
Enter your repository name as github username/repository name.
Next, you need to enter the OAuth token for WordPress-GitHub sync in a textbox below repository name. Click the personal oauth link given in dashboard. You will be taken to a different web page where you need to fill in details about your desired oauth token. Enter token description as ‘wordpress sync’ or anything else as per your requirement. Select scope as ‘public_repo’ and click generate token.
Copy paste the OAuth token displayed on your screen into the textbox mentioned above.
Click the link ‘Export to GitHub’ at the bottom of form, in Bulk Actions section. This will begin the export process.
5. Verify Backup
If you go to GitHub Profile->Repositories->WordPress you will find the contents of your WordPress website present there.
6. Restore from GitHub Backup
In case you ever need to restore your WordPress website from GitHub repository, open WordPress Admin, go to Settings-> GitHub Sync -> Import from GitHub in ‘Bulk Actions’ section.
In this article, we have learnt how to backup WordPress to GitHub as well as how to restore backup from GitHub. You can customize your repository as per your requirement.
How to Backup WordPress to Google Drive
How to Print Without Newline or Space in Python
How to Convert String Representation to List
How to Set Current Directory to Shell Script Directory
How to Change Shutdown Message in Linux