Getting Started with WordPress  第一篇 开始WordPress之旅

今天是第一章 安装WordPress (Installation) 的 第五节 升级WordPress (Upgrading WordPress)。

Upgrading WordPress

Before you get started, make sure you meet the minimum requirements.

Three Step Upgrade
These are the short instructions, if you want more check out the
extended upgrade instructions. If you experience problems with the Three Step Upgrade, you may want to review the more detailed upgrade instructions.

For these instructions, it is assumed that your blog’s URL is http://example.com/wordpress/. Note that during the upgrade process access to your blog may not work for your visitors. You may consider a plugin like Maintenance Mode.

A Warning before you start
If you run into problems Upgrading WordPress with the three Steps described here, you need to revert to your old version first before using the
more detailed upgrade instructions (ie. restore the backup made in step 0). Even though you might not run into any errors with this process right away, you might run into problems later down the line. Then it may not be possible to revert far enough back to fix the problem without losing any recent changes.

So If you use Plugins and Themes other than the ones that come with the default WordPress installation, it is advisable to start over with the more detailed upgrade instructions.

Step 0: Before You Get Started
Just in case something goes wrong, make sure you have a backup.
WordPress Backups is a comprehensive guide.
Make sure the database user name registered to WordPress has permission to create, modify, and delete database tables. If you installed WordPress in the standard way, and nothing has changed since then, you are fine.
Deactivate your plugins. A plugin might not be compatible with the new version, so it’s nice to check for new versions of them and deactivate any that may cause problems. You can reactivate plugins one-by-one after the upgrade.

Step 1: Replace WordPress files
Get the
latest WordPress. Either download and extract it to your computer or download it directly to the server.
As a reminder, to extract a tar.gz to a folder use this command, replacing (folder name) with the name of your folder: tar -xvzf latest.tar.gz -C ./(folder name)
Delete your old wp-includes and wp-admin directories.
Copy the new WordPress files to your server, overwriting old files in the root, except perhaps the wp-content folder (see “NOTE” below). You may use FTP or shell commands to do so. Note that this means *all* the files, including all the files in the root directory as well. If you use the default or classic theme and have customized it, then you can skip that theme.
NOTE   The wp-content folder requires special handling, as do the plugins and themes folders. You should copy over the contents of these folders, not the entire folder. In some cases, copying the entire folder may overwrite all your customizations and added content.

Also take care to preserve the content of the wp-config.php file in the root directory. This file contains current settings for your existing installation, e.g. database sign-in information. Occasionally new versions of WordPress adds statements to this file. (E.g. in version 2.5 the SECRET_KEY variable was added, see Extended upgrade instructions). Compare your existing file with the new installation file which is named wp-config-sample.php. Either transfer your settings to the sample-file and rename it to wp-config.php or copy the new statements from the sample file into your current file.

Step 2: Upgrade your installation
Visit your main WordPress admin page at /wp-admin. You may be asked to login again. If a database upgrade is necessary at this point, WordPress will detect it and give you a link to a URL like http://example.com/wordpress/wp-admin/upgrade.php. Follow that link and follow the instructions. This will update your database to be compatible with the latest code. If you fail to do this step, your blog might look funny.

Step 3: Do something nice for yourself
If you have caching enabled, your changes will appear to users more immediately if you clear the cache at this point (and if you don’t, you may get confused when you see the old version number in page footers when you check to see if the upgrade worked).

Your WordPress installation is successfully upgraded. That’s as simple as we can make it without Updating WordPress Using Subversion.

Consider rewarding yourself with a blog post about the upgrade, reading that book or article you’ve been putting off, or simply sitting back for a few moments and let the world pass you by.

Troubleshooting
If anything has gone wrong the first thing to do is go through all the steps in our
extended upgrade instructions. That page also has information about some of the most common problems we see.

升级WordPress

  开始之前,确认你已经阅读了安装和升级WordPress的最低要求

升级的三个步骤
  这里只给出简略的升级提示,当然你还可以得到更多的更详细的升级指示。如果你在按照这里的三个步骤升级WordPress时遇到问题,你可以查阅升级提示的细节
  这些提示都假定你的博客网址的URL是类似http://example.com/wordpress/的形式 。请注意,在升级的过程中,访客可能无法正常打开你的博客网页。并且,你还可能需要将所有已安装的WordPress插件设定维护模式成并禁用。

开始前的注意事项
  如果你通过这里提示的三个步骤升级WordPress时碰到问题,你首先要做的是需要根据升级提示的细节把EordPress恢复到升级前的老版本(例如:通过先期步骤来还原先前的备份版本)。即便你可能在升级过程中不会马上遇到问题,也无法保证稍后不会碰到问题。到那时,如果没有事先的备份,你的WordPress可能无法恢复到足以解决问题的状态,同时又不会因此而丢失任何最近所做的更改。
  因此,如果你正在使用非WordPress默认的其他的插件和主题,你最好仔细阅读升级提示的细节后再升级。

先期步骤:开始之前
  只要保证每当碰到问题和错误,你都有备份的文件可以恢复即可。WordPress备份里有十分详尽的综合性指导。
  必须确认你为WordPress注册的数据库用户名已经被允许创建、修改和删除数据库表。当然,如果你是按照标准的步骤和方式安装WordPress,并且没有任何的更改,那应该没什么问题。禁用你的所有插件。因为 某些插件可能不兼容最新的WordPress版本,所以你最好禁用并检查这些插件是否有新版本,以避免可能发生的任何问题。你可以在升级完成后再重新启用这些插件。

第一步:替换WordPress文件
  获取最新版本的WordPress。你可以将最新版本的WordPress下载到你的计算机上并解压缩,或者直接传到你的WordPress主机里。
  提示一下,提取tar.gz中的文件到一个文件夹中可以使用此命令,用你自己的文件夹名称来替换括号里的内容:tar -xvzf latest.tar.gz -C ./(folder name)。
  删除旧的wp-includes目录和wp-admin目录。
  复制新的WordPress文件到你的主机,并覆盖WordPress程序根目录下旧版本的WordPress文件,也许在wp-content文件夹里的有部分内容需要保留(详见下文“注意”)。你可以通过使用FTP客户端软件或输入命令行命令来进行这一步的操作。请注意,这一步要覆盖全部文件和文件夹,包括根目录下的所有文件夹及其所有子文件夹。当然,如果你正在使用的是WordPress默认或WordPress经典主题,并已个性化定制,那可以跳过并保留这一主题。
  注意 在wp-content文件夹中有一些文件夹需要特别注意,即存放WordPress插件和主题的文件夹。你可以只覆盖除了这些文件夹以外的其他wp-content文件夹中的文件。不然,在有些情况下,覆盖了整个文件夹中反而也会覆盖掉你之前所有的自定义和补充的内容。
  另外,你还要注意保存根目录下的wp-config.php文件。此文件包含当前的WordPress设置,以及现有的安装信息,比如数据库的登录信息。有时,新版本WordPress新增特性的说明也在包含此文件中。(例如,在v2.5版本的WordPress中关于secret_key变量的补充,见更多的更详细的升级指示) 。比较一下你现有的wp-config.php文件与新版本WordPress里wp-config-sample.php文件的内容,然后,你可以复制原有的WordPress设置到wp-config-sample.php文件并将该文件重命名为wp-config.php,或者把wp-config-sample.php里关于新增特性的说明复制到你当前的wp-config.php文件中。

第二步:升级安装
  访问你的WordPress管理首页/wp-admin,你可能会被要求再次登录。这一步中,你有需要升级你的WordPress数据库。WordPress会自动侦测并给出类似如下的链接,http://example.com/wordpress/wp-admin/upgrade.php。点击该链接,并按照网页的提示进行升级。完成这一步骤,你的数据库将被更新,并可以兼容WordPress的最新版本。反之,如果你的数据库未被更新或更新失败,你的博客浏览起来可能会有问题。

第三步:做的更完美一些
  如果你的主机启用了网页缓存,请尽快地清除网页缓存并刷新以便你的访客能更快地看到升级后的变化(不然,当升级工作完成后,你在页面的页脚位置看到显示的是老的WordPress版本号时会感到困惑)。
  至此,你的WordPress成功升级。就那么简单,你就可以使你的WordPress完美地升级并毫无瑕疵地运行
  你可以考虑是不是要发一个关于这次成功升级的帖子给自己做为奖励,要么就读一读你一直想读却没有读的书或文章,或者干脆呆坐几分钟,感受一下世界的美好。

问题的解决
  任何时候出了错,你要做的第一件事就是根据更多的更详细的升级指示来检查所有的步骤。此网页还有我们发现的一些常见问题的资料供你参考。

, , ,
Trackback

本文到目前为止还暂无回复

添加回复