Pages

Thursday, 3 January 2013

利用插件自动备份wordpress博客到谷歌网盘(Google Drive)

无论你对博客程序 WordPress 是否熟悉,其安装之后的一项必不可少的工作就是做好备份,而且应该是有规律的定期备份,以备在遇到服务器宕机、黑客攻击或插件问题等造成的数据丢失时恢复之用。
Oli 曾经在他近期的一篇文章“ 7 使用 WordPress 7年获得的7条经验教训”中阐述过备份 WordPress 的好处,在此我想引用他的一段话 …
Sooner or later, something will go wrong with your site – whether that’s a hosting failure, a hacking, a plugin problem – backing up regularly will prevent any stress should this happen. Depending on the scale of your site you will want to keep an hourly, daily or weekly backup incase something goes wrong. We have looked at the Backup Buddy plugin and a free plugin to backup to Dropbox in the past. I would recommend one of these solutions in addition to the backup provided by your web hosting company.
今天的这篇教程讲的是“如何自动备份 WordPress 到 Google drive”。Google Drive,也就是“谷歌网盘”,是谷歌于今年(2012年)4月24日推出的一项新的云存储服务,每位新用户都可以免费获得5GB容量的存储空间, 你也可以根据需要按每月支付2.45美元的方案将存储空间升级到25GB,或每月支付4.99美元即可获得100GB的存储空间。

备份 WordPress 的方法有许多,其中不乏使用插件的方式。在这里我就为大家介绍一款插件 Google Drive for WordPress,通过这款插件能够轻易地将你的 WordPress 博客备份到谷歌网盘。
安装插件
下载 Google Drive For WordPress 插件,然后登录你的 WordPress 后台控制面板,来到“插件” > “添加新插件” > “上传插件”,上传刚才下载来的 Google Drive For WordPress 插件,安装。

激活插件后,你会在左边菜单列表中多了一条“Configure Google Drive(配置 Google Drive)”的选项。
授权 Google Drive For WordPress 插件访问你的谷歌网盘

在插件配置页面上方打开“Google Api Console”链接,来到如下新页面:

点击“ Create Project(创建项目)”,然后命名此项目,如“Wplift Backup”,填写你的谷歌帐户ID,再上传一个 Product Logo(可选的)。

创建 client Id(客户ID):点击 “Next”,在出现的程序类型中就填上“Web Application”,再点击“ more option(更多选项)” ,你会看到更多选项,包括:
“Authorized Redirect URIs”,允许的重定向网址,就好像“http://yoursite.com/wp-admin/admin.php?page=configure_google&action=auth”。

Authorized JavaScript Origins”,也就是你的网址。
点击“ create account id(创建帐户ID)”,获取“Client ID”和“Client secret”。

然后将获得的“Client ID”粘贴到插件配置页面相应的位置,最后点击“Allow Access(允许访问)”。

配置 Google Drive For WordPress 插件
插件获得访问你的 Google drive 权限后,接着下来就可以设定备份 WordPress 的类型了,你可以选择仅仅备份文件,也可以选择只备份数据库,或者两者同时备份。
1.设置自动备份,这部分包括几个选项:命名备份文件夹;是否启用邮件提醒;定时备份等。

2. 数据库备份,这部分允许你根据需要选择是否备份 WordPress 数据库或管理数据库备份文件:

3.管理备份文件,如设定备份文件的数量,下载、移动或删除备份文件等。

手动备份
这个选项允许你手动备份 WordPress,也就是说,你可以在需要的时候才备份一次 WordPress,只要点击“Backup Now(立刻备份)”按钮即可,此后你会收到邮件通知。
在Google Drive上查看备份文件
使用你的谷歌帐户登录谷歌网盘就可以查看并管理你的 WordPress 备份文件了。
--------------------------------------------------------------------------------------
英文原文:

How To: Backup Your WordPress site to Google Drive


Whether you are new to WordPress or an expert, you should know that backing-up your wordpress blog is an essential step you must take after installation of your WordPress site. Not just once but regularly to prevent loss of your work after a hosting failure, hacking attack or even plugin failure .
Oli explained the benefits of backing-up your wordpress in his latest article “7 Lessons Learned from 7 Years of using WordPress” and I want to quote his words …
Sooner or later, something will go wrong with your site – whether that’s a hosting failure, a hacking, a plugin problem – backing up regularly will prevent any stress should this happen. Depending on the scale of your site you will want to keep an hourly, daily or weekly backup incase something goes wrong. We have looked at the Backup Buddy plugin and a free plugin to backup to Dropbox in the past. I would recommend one of these solutions in addition to the backup provided by your web hosting company.
Today’s Tutorial is about “How to backup WordPress to Google drive” before we go through the tutorial we need to know what is Google’s latest amazing service ” Google Drive“. Google Drive is new Cloud Storage service by Google that was released on April 24, 2012. Google Drive gives all users 5 GB of cloud storage to start with, You can upgrade your plan from 5GB to 25GB by paying small fee  of $2.45/month” or 100GB for $4.99 / Month.

In this Guide I’ll  show you how to use the free wordpress plugin “Google Drive for WordPress” to backup your WordPress  site regularly or manually and how to store those backups on Google drive.

Install The Plugin

Download Google Drive plugin, then in your WordPress admin, visit “Plugins” > “Add New” > “Upload” and upload the file.
Activate the plugin and you will see a new menu item called “Configure Google Drive”

Configure The Plugin To get Access To Your Google Drive


Open ” Google Api Console” in new tab so you can create Authorize client Id.

Click Create Project, Then give the project name for example “Wplift Backup” and Logo image url to show next to your project.See below.
Create client Id: Click “Next” Then the application type “Web Application” and then click more option so you able to select both
“Authorized Redirect URIs” Given by the plugin and you can find it in the plugin admin page it will be some thing like “http://yoursite.com/wp-admin/admin.php?page=configure_google&action=auth”.
and
Authorized JavaScript Origins” Which is your site address.
Click create account id then get the “Client ID” and “Client secret” as seen in the example below.

Then paste the Ids in to the plugin admin page and click “Allow Access” see below.

Configure The Plugin

Now after authorize the plugin to use Google drive as remote backup storage you need to configure the plugin to select the type of backup you wish to have if it “Files only ” Database only” or both.
1: Backup Setting, there you can see the plugin setting whatever you need to receive E-mail notification if the backup done or not,BackUp Schedule ( Schedule an automatic backup on your google drive) and finally the time of next Schedule.

2: Database Setting, Where you can chose if you want to include the database in the backup or not, Exclude some tables and not include them in the database backup, Select number of database backup you want to keep in Google drive from one to three or manage old database by “Download,Move or Delete”.

3: Manage Files, Like said before in the database setting you can exclude some files from the backup process, Set Backup Limit and Manage old backups.

One Time Backup

This option allow you to do manaul backups and you can also test if the plugin work for you or not by click”backup now” after clicking the button it will show ” Processing” and after the plugin finish the job you will receive a notification E-mail with the backup info.

Check backups on Google Drive

After successful backup you can manage your backup files in your Google Drive account it will be some thing like the example below.

from http://wplift.com/how-to-backup-your-wordpress-site-to-google-drive