Wordpress 中文
Advertisement

最新版本WordPress 2.0.3, 已经释出。如果你正好需要从WordPress 2.0.2 升级到 2.0.3, 请参照下述专门的介绍 从 2.0.2 升级到 2.0.3。对于其他的升级,比如 1.5.2 to 2.0.3 或者 2.0 or 2.0.1 to 2.0.3, 请参照详细介绍 或者 升级五步曲.

升级五步曲[ | ]

升級WordPress 可能有點狡猾, 但是不要怕, 這份指南會幫助您快速地升級讓您的WordPress更加地有生氣! 這個程序會提供只是讓你可以免於災難(其他的軟體供應商稱這是"使用者錯誤").

在開始之前, 你需要知道WordPress 本身很容易升級. 保留你之前定製的程式部分用升級五部曲來取代之前的升級三部曲. 相信這應該是5分鐘的程序吧, 但是關於備份您的資料及檔案再您是一個量產的博克時可能需要多於5分鐘吧.


讓我們加設您的部落格有一個網址像是http://example.com/wordpress/.

安全的升級步驟如下所示:

步驟 1: 備份資料庫資料表及檔案包括.htaccess[ | ]

這個目的是為了保存資料及你定製程式的部分

步驟 1a: 保存資料[ | ]

使用phpMyAdmin 或您用的web主機提供的其他合適工具, 使用WordPress來 備份資料庫 .

步驟 1b: 保存定製的程式部分[ | ]

基本上備份檔案 是指您安裝了標準的WordPress後更改或新增的部分. 使用 FTP 工具 來下載伺服器中所有檔案的拷貝一份, 這個部分包括.htaccess 檔案. 至少備份 .htaccess 檔案, 你現在使用的佈景主題的檔案(這些檔案放在/wp-content/ 目錄中), 在/wp-images/ 目錄裡面有您上傳的影像及檔案, 任何您所使用"修改"的目錄裡的WordPress 核心檔案, 以及wp-config.php 這個檔案包含了資料庫的帳號及密碼的資訊等等.

步驟 2: 撤銷外掛[ | ]

撤銷您在外掛程式管理所有的外掛 ( http://example.com/wordpress/wp-admin/plugins.php ). 有些外掛可能跟WordPress不相容 Template:目前的版本, 而這就是為什麼要撤銷所有的外掛的原因. 這可以擔保您在升級WordPress後卻無法使用的危險.

步驟 3: 覆寫檔案[ | ]

取得最新版的WordPress 以及上傳到WordPress 目錄, 覆寫所有已存在的檔案. 這樣可以保存您的影像及佈景. 您會問這會有什麼問題嗎? 嗯, 在步驟 1如果你沒有備份所有的檔案的話? 可能就會發生最糟的錯誤劇情. 移除伺服器上舊的檔案 以及上傳您下載的新版本是另一個確保伺服器上的檔案已被取代.

步驟 4: 執行升級的程式[ | ]

訪問您的部落格的升級頁面( http://example.com/wordpress/wp-admin/upgrade.php ) 並且根據顯示的資訊操作.

步驟 5: 將外掛一個個地重新啟用[ | ]

外掛管理程式這裡一個接一個地喚醒這些怪物 ( http://example.com/wordpress/wp-admin/plugins.php ). 確認每件工作是否如預期進行. 在 WordPress 2.0可以相容的外掛清單中可以參考. 假如有些外掛不能正常運作, 停用這個外掛, 然後聯絡這個外掛的作者以鼓勵他升級這個外掛.

就是那樣.

您說如果有錯誤怎麼辦? 不用擔心. 因為早先你已備份所有的資料及檔案, 現在你可以將備份的資料庫資料表還原回去, 可以參閱詳細的操作 .



详细介绍[ | ]

在開始之前[ | ]

  1. 備份您的資料庫.
  2. 備份所有的WordPress 檔案, 包括 .htaccess 假如您有的話.
  3. 確認您備份的檔案已經在那裡了而且是可用的.
  4. 停用所有的外掛.

重要: 假如你沒做好完整的備份不要嘗試升級.

升級程序概述[ | ]

  1. 備份資料庫. 閱讀 Backing Up Your Database 有詳細的說明.
  2. 在你的WordPress的目錄裡備份所有WordPress 檔案 . 部要忘記您的.htaccess 檔案.
  3. 確認備份 是否已建在那了並且可以使用. 這是一定要的.
  4. 停用所有的外掛.
  5. 確認前面四個步驟已經完成. 除非你已完成前面四各步驟否則不要嘗試升級.
  6. 從http://wordpress.org/download/下載並且解壓縮 WordPress 套件 .
  7. 將您站上的舊的WordPress檔案刪除掉 , 但是 不要刪掉
    • wp-config.php 檔案;
    • wp-content 資料夾; 特別例外的: 這個 wp-content/cache 資料夾應該被刪除.
    • wp-images 資料夾;
    • wp-includes/languages/ folder--if you are using a language file do not delete that folder;
    • .htaccess file--if you have added custom rules to your .htaccess, do not delete it;
    • robots.txt file--if your blog lives in the root of your site (ie. the blog is the site) and you have created such a file, do not delete it.
  8. Upload the new files from your computer's hard drive to the appropriate WordPress folder on your site.
  9. Run the WordPress upgrade program and follow the instructions on the screen.
  10. Update Permalinks and .htaccess. Update your Permalink Structure and merge the custom rules, if necessary, into your .htaccess file.
  11. Install updated Plugins and Themes. Please review the list of Plugins that work in Version 2.0 and check if your Theme author has a new version.
  12. Reactivate Plugins
  13. Review what has changed in WordPress.

That's the overview of the upgrade process. Please continue reading the Detailed Upgrade Instructions.

Remember, if you do encounter problems, re-read the Instructions below to insure you've followed the proper procedures and consult Troubleshooting: Common Installation Problems.

Detailed Upgrade Instructions for 1.5.x to 2.0.3 and 2.0 to 2.0.3[ | ]

The following are the instructions that explain the above steps in more detail. Please read all of the instructions before starting.

Step 1: Back up your database[ | ]

Perform a backup of your database. All of your WordPress data, such as Users, Posts, Pages, Links, and Categories, are stored in your MySQL database. Please read Backing Up Your Database for a detailed explanation of this process.

It is extremely important to back up your database before beginning the upgrade. If, for some reason, you find it necessary to revert back to the 'old' version of WordPress, you may have to restore your database from these backups.

Step 2: Back up ALL your WordPress files[ | ]

Back up ALL of your files in your WordPress directory and your .htaccess file. Typically, this process involves using an FTP program to download ALL your WordPress files from your host to your local computer. Please read Backing Up Your WordPress Site for further explanation.

If you have made changes to any core WordPress files, or if you've got customized Plugins or Themes, you will want to have a good backup of those files. It is extremely important to back up your files before beginning the upgrade. If for some reason you find it necessary to revert back to the 'old' version of WordPress you will need to upload these files.

Step 3: Verify the backups[ | ]

Verify that the backups you created are there and usable. This is the most important step in the upgrade process! The verification process involves making sure you can see the backup files on your local computer (or wherever you've stored them) and that you can navigate into any sub-folders. If the files are in a zip file, make sure you can open the zip file.

Step 4: Deactivate ALL your Plugins[ | ]

In your Administration panel, under the Plugins choice, deactivate any Plugins. Because of the changes to WordPress, some Plugins may conflict with the upgrade process.

Step 5: Ensure first four steps are completed[ | ]

If you have not completed the first four procedures, STOP, and do them! Do not attempt the upgrade unless you have completed the first four steps.

The best resource for problems with your upgrade is the WordPress Support Forums, and if you have problems, the volunteers at the WordPress Support Forums will likely ask if you have completed the first four steps.

Step 6: Download and extract the WordPress package[ | ]

Download and unzip the WordPress package from http://wordpress.org/download/.

  • If you will be uploading WordPress to a remote web server, download the WordPress package to your computer with your favorite web browser and unzip the package.
  • If you have shell access to your web server, and are comfortable using console-based tools, you may wish to download WordPress directly to your web server. You can do so using wget , lynx or another console-based web browser, which are valuable if you want to avoid FTPing. Place the package in a directory parallel to your current wordpress directory (like "blog" for example). Then, unzip it using: gunzip -c wordpress-Template:CurrentVersion.tar.gz | tar -xf - or by using: tar -xzvf latest.tar.gz

The WordPress package will be extracted into a folder called wordpress.

Step 7: Delete the old WordPress files[ | ]

Why Delete? Generally, it is a good idea to delete whatever is possible because the uploading (or upgrading through cPanel) process may not correctly overwrite an existing file and that may cause problems later.

DO NOT DELETE these folders and files:

  • wp-config.php file;
  • wp-content folder;
  • wp-images folder;
  • wp-includes/languages/ folder--if you are using a language file, do not delete this folder;.
  • .htaccess file--if you have added custom rules to your .htaccess, do not delete it;
  • Custom Content and/or Plugins--if you have any images or other custom content or Plugins inside the wp-content folder, do NOT delete them.

Delete these Files and Folders:

  • wp-* (except for those above), readme.html, wp.php, xmlrpc.php, and license.txt; files; Typically files in your root or wordpress folder. Again, don't delete the wp-config.php file.
  • wp-admin folder;
  • wp-includes folder; If using a language file remember don't delete the wp-includes/languages/ folder
  • wp-content/cache folder; You only see this folder if you are upgrading FROM WordPress 2.0.

How to Delete? There are several ways to delete the files from your WordPress site. You can use your FTP Client, or if you have access to Telenet or SSH you can use that. Some host providers also provide the ability to delete files and folders.

Using FTP to delete files and folders
The same FTP client you use for uploading can be used to delete files and folders. If your FTP client does not appear to permit you to delete non-empty folders, check the available options for your FTP client. You'll usually find an option that permits deleting non-empty folders. Deleting non-empty folders is a quick and thorough method cleaning out an old installation of WordPress. It is recommended that once the deleting is done, you switch back to the original setting for safety reasons.
Using Telnet or SSH to delete file
If you have a command-line login (telnet or ssh), you can enter the following commands to make backup copies of the files you need to keep and to delete ONLY the wordpress files in your directory (plus .htaccess):
  • mkdir backup
  • cp wp-config.php .htaccess backup
  • cp -R wp-content backup
  • rm wp*.php .htaccess license.txt readme.html xmlrpc.php
  • rm -rf wp-admin wp-includes
  • cp backup/wp-config.php .
  • After you have finished with the upgrade, you can restore any customizations to your templates or plugins from your backup directory. For example, cp backup/index.php.
Alternatively, using SSH, you could copy wp-config.php, .htaccess, and any content files you've added or altered into the new wordpress directory. Then, rename the old one (to archive it), and move the new one into its place.

Step 8: Upload the new files[ | ]

With the new upgrade on your local computer, and using FTP, upload the new files to your site server just as you did when you first installed WordPress. See Using FileZilla and Uploading WordPress to a remote host for detailed guidelines in using an FTP Client to upload.

NOTE: If you did not delete the wp-content folder, you will need to overwrite some files during the upload.

The wp-content folder holds your WordPress Themes and Plugins. These should remain. Upload everything else first, then upload only those WordPress files that new or changed to your new wp-content folder. Overwrite any old versions of default plugins with the new ones.

The WordPress default theme has changed so you will want to upload the wp-content/themes/default folder. If you have custom changes to the default theme, those changes will need to be reviewed and installed after the upgrade.

Step 9: Run the WordPress upgrade program[ | ]

Run the WordPress upgrade script by accessing wp-admin/upgrade.php in your favorite web browser and follow the instructions presented on your screen.

  • If WordPress is installed in the root directory, point your browser to: http://example.com/wp-admin/upgrade.php
  • If WordPress is installed in its own subdirectory called blog, for example, point your browser to: http://example.com/blog/wp-admin/upgrade.php

Step 10: Update Permalinks and .htaccess[ | ]

In your Options->Permalinks panel update your Permalink Structure and, if necessary, place the rules in your .htaccess file. Also see Using Permalinks for details regarding Permalinks and the .htaccess file.

Step 11: Install updated Plugins and Themes[ | ]

Please review the list of Plugins that work in Version 2.0. You will want to upload and install any new versions of your Plugins and Themes. Check with the author of those Plugins and Themes for the updated versions.

Step 12: Reactivate Plugins[ | ]

Use your Administration Panel, Plugins, to activate your Plugins.

Please note that if you are using the new WordPress Database Backup Plugin you may need to change the permissions on your wp-content folder to make it writeable by your webserver (either mode 666 or even 777). See Changing File Permissions for more details.

Step 13: Review what has changed in WordPress[ | ]

As of now, there is no official list in Codex that describes all the new features, but look at these resources:

从 2.0.2 升级到 2.0.3[ | ]

这是一个安全上的升级。在WordPress官方Blog2.0.3发布声明.

在升级过程当中,/wp-content/文件夹的所有东西保持原样。

  1. 删除/wp-admin/ 文件夹.
  2. 删除/wp-includes/ 文件夹. 注意: 你可能需要事先备份文件夹/wp-includes/languages/(如果存在此文件夹的话)
  3. 删除主目录(即包含index.php的那个文件夹)下所有文件。注意:不要删除 wp-config.php.
  4. 下载并解压缩最新版的WordPress.
  5. 上传到合适的文件夹,比如 /wp-admin//wp-includes/.
  6. 上传其他文件到根目录下。
  7. 复原原来备份的/wp-includes/languages/目录,如果有的话。
  8. 以管理员身份登陆,你将被提示升级WordPress的数据库。

升级完毕。

Upgrade Instructions in Other Languages[ | ]

Troubleshooting[ | ]

Scrambled Layout or Errors
If your blog looks scrambled now or features line errors, an old plugin that doesn't work with the new code may be the culprit. In your WordPress Administration Panel, deactivate all plugins that do not come with WordPress by default. Re-activate them one by one.
Made Custom Changes/Hacks?
If you have made changes to other WordPress files ("hacked" WordPress), you are supposed to keep track of your changes. You will have to transfer your edits into the new code. WordPress Versions lists the files that have changed in each release.
Resist Using Old Code
Upgrading gives you the newest and best code. Using your old code, no matter how much you have customised it, almost certainly will cause problems. The temptation just to use your old modified code will be great, but the chances of errors are much greater.
Can I Go Back to Old Versions
You can, but it is usually not recommended to rollback (revert) your current version to an older version. That is because newer versions often include security updates and a rollback may put your site at risk. Second, the change between the database structure between versions may cause complications in maintaining your site content, posts, comments, and plugins that are dependent upon the information stored in the database. If you are still intent on this, proceed at your own risk. Please note, that without a backup of your entire site and your database, made prior to your upgrade attempt, a successful rollback is near impossible. Delete all WordPress files except for wp-config. Upload the files from your backup to your server and restore your database backup. Remember, you must have good backups for the rollback to work. For older WordPress versions, a rollback might not work.
Get More Help
If you get any errors following an upgrade, check Troubleshooting: Common Installation Problems, Troubleshooting, and the Codex Installation Category of Articles. If you can't find an answer, post a clear question on the WordPress Suppport Forums. You will be asked if you have used any old code. You'll be told to change it then, so you may as well change it now :)

Old Upgrade Information[ | ]

If you are considering upgrading to WordPress Version 2.0.1, but you are at Version 1.2, then follow the 1.2 to 1.5 upgrade as describe in Upgrading From WordPress Version 1.2 to 1.5. Once you are upgraded to Version 1.5.x, then follow the instructions as listed above to upgrade from 1.5 to 2.0.1.

Advertisement