升级 WordPress 进阶
- 备份您的数据库. Read Backing Up Your Database for a detailed explanation.
- Backup ALL your WordPress files in your WordPress directory. Don't forget your tt.htaccess/tt file.
- Verify the backups you created are there and usable. This is essential.
- Deactivate ALL your Plugins.
- Ensure first four steps are completed. Do not attempt the upgrade unless you have completed the first four steps.
- Download and extract the WordPress package from http://wordpress.org/download/.
- Delete the old WordPress files on your site, but span style=color:redDO NOT DELETE/span
- codespan style=color:redwp-config.php/span/code file;
- codespan style=color:redwp-content/span/code folder; Special Exception: the codewp-content/cache/code and the codewp-content/plugins/widgets/code folders should be deleted.
- codespan style=color:redwp-images/span/code folder;
- codespan style=color:redwp-includes/languages//span/code folder--if you are using a language file do not delete that folder;
- codespan style=color:red.htaccess/span/code file--if you have added custom rules to your code.htaccess/code, do not delete it;
- codespan style=color:redrobots.txt/span/code 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.
- Upload the new files from your computer's hard drive to the appropriate WordPress folder on your site.
- Run the WordPress upgrade program and follow the instructions on the screen.
- Update Permalinks and .htaccess. Update your Permalink Structure and merge the custom rules, if necessary, into your tt.htaccess/tt file.
- Install updated Plugins and Themes. Please review the list of Plugins that work in Version 3.0. Check for Theme Compatibility with 3.0 and ask your Theme author for any new version.
- Reactivate Plugins
- Add security key definitions to the wp-config.php file
- 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.
Upgrading from Version 2.7.x to 3.0
Detailed Upgrade Instructions for 1.5.x, and versions 2.0 - 2.6.5, to 3.0
The following are the instructions that explain the above steps in more detail. Please read all of the instructions before starting.
第 1步: 备份您的数据库
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 tt.htaccess/tt 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. Also consider opening a .sql file in an editor to see if the tables and data are represented.
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 ttwget/tt , ttlynx/tt 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 uploads, for example). Then, unzip it using: ttgunzip -c wordpress-3.0.tar.gz | tar -xf -/tt or by using: tttar -xzvf latest.tar.gz /tt
The WordPress package will be extracted into a folder called ttwordpress/tt.
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.
span style=color:redDO NOT DELETE/span these folders and files:
- codewp-config.php/code file;
- codewp-content/code folder;
- codewp-images/code folder--only older installations from 1.5.x days will have this folder;
- codewp-includes/languages//code folder--if you are using a language file, and it is here rather than in ttwp-content/languages//tt, do not delete this folder (you might want to move your language files to ttwp-content/languages//tt for easier upgrading in the future);.
- code.htaccess/code file--if you have added custom rules to your code.htaccess/code, do not delete it;
- Custom Content and/or Plugins--if you have any images or other custom content or Plugins inside the codewp-content/code folder, do NOT delete them.
Delete these Files and Folders:
- codewp-* (except for those above), readme.html, wp.php, xmlrpc.php, and license.txt; /code files; Typically files in your root or wordpress folder. Again, don't delete the codewp-config.php/code file. Note: some files such as wp.php may not exist in later versions such as 2.7.
- codewp-admin/code folder;
- codewp-includes/code folder; If you have a language file here, remember not to delete the codewp-includes/languages//code folder
- codewp-content/cache/code folder; You only see this folder if you are upgrading FROM WordPress 2.0.
- codewp-content/plugins/widgets/code folder; You only see this folder if you previously installed the Sidebar Widgets plugin. The Sidebar Widgets code conflicts with the built-in widget ability.
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). If you've customized other files (like codeindex.php/code) not included by the codecp/code commands below, copy them as well:
- codemkdir backup/code
- codecp wp-config.php .htaccess backup/code
- codecp -R wp-content backup/code
- coderm wp*.php .htaccess license.txt readme.html xmlrpc.php/code
- coderm -rf wp-admin wp-includes/code
- codecp backup/wp-config.php ./code
- After you have finished with the upgrade, you can restore any customizations to your templates or plugins from your backup directory. For example, use codecp backup/index.php ./code to restore codeindex.php/code.
- Alternatively, using SSH, you could copy codewp-config.php, .htaccess/code, 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 codewp-content/code folder, you will need to overwrite some files during the upload.
The codewp-content/code folder holds your WordPress Themes and Plugins. These should remain. Upload everything else first, then upload only those WordPress files that are new or changed to your new codewp-content/code 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 codewp-content/themes/default/code 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
Using a web browser, go to the WordPress admin pages at the normal /wp-admin location. WordPress will check to see if a database upgrade is necessary, and if it is, it will give you a new link to follow.
This link will lead you to run the WordPress upgrade script by accessing ttwp-admin/upgrade.php/tt. Follow the instructions presented on your screen.
Note: Make sure the database user name registered to WordPress has permission to create, modify, and delete database tables before you do this step. If you installed WordPress in the standard way, and nothing has changed since then, you are fine.
If you want to run the upgrade script manually:
- If WordPress is installed in the root directory, point your browser to: ttnowikihttp://example.com/wp-admin/upgrade.php/nowiki/tt
- If WordPress is installed in its own subdirectory called ttblog/tt, for example, point your browser to: ttnowikihttp://example.com/blog/wp-admin/upgrade.php/nowiki/tt
If you experience difficulties with login after your upgrade, it is worth clearing your browser's cookies.
In your Administration Settings Permalinks panel update your Permalink Structure and, if necessary, place the rules in your tt.htaccess/tt file. Also see Using Permalinks for details regarding Permalinks and the tt.htaccess/tt file.
Step 11: Install updated Plugins and Themes
Please review the Plugin Compatibility List and Theme Compatibility List, or plugin/theme authors, to find plugins and themes compatible with your new WordPress version. Upload and install new versions of your Plugins and Themes, if necessary.
Step 12: Reactivate Plugins
Use your Administration Panel, Plugins, to activate your Plugins. If your plugins do not appear on the Plugin Compatibility List and you are not sure if they will work correctly with the new version, activate each plugin, one at a time, and test that there are no problems before continuing. !--Please note that if you are using the new WordPress Database Backup Plugin you may need to change the permissions on your codewp-content/code folder to make it writeable by your webserver (either mode 666 or even 777). See Changing File Permissions for more details. --
Step 13: Add security key definitions to the wp-config.php file
Beginning with WordPress Version 2.6, three (3) security keys, AUTH_KEY, SECURE_AUTH_KEY, and LOGGED_IN_KEY, are used to insure better encryption of information stored in the user's cookies. Beginning with Version 2.7 a fourth key, NONCE_KEY, was added to this group.
If you don't find the keys in your codewp-config.php/code file, add the keys definitions with reference to Editing wp-config.php - Security Keys, and upload to your server.
Step 14: Review what has changed in WordPress
Please review these resources to see what's new in WordPress:
Special note for Fantastico Upgrades
When using the Fantastico upgrade process to upgrade from a pre-Version 2.2, Fantastico will use the wp-config-sample.php file to regenerate a new wp-config.php file. By doing this, two new values, DB_CHARSET and DB_COLLATE, are placed into the wp-config.php file. Those lines should be deleted from your wp-config.php if you are upgrading from a pre-Version 2.2 (like 2.0.10 or 2.1.3) to Version 3.0. A detailed explanation about DB_CHARSET and DB_COLLATE can be found in Editing wp-config.php.
!-- saving for later upgrades
Upgrade 2.0.6 to 3.0
This is a security upgrade. Information can be found in the WordPress Dev Blog 2.0.7 Announcement.
As with all WordPress upgrades, the contents of your code/wp-content//code folder should remain intact and unchanged except as noted below.
- Delete code/wp-admin//code folder.
- Delete code/wp-includes//code folder. Note: You must backup code/wp-includes/languages//code directory if exists. Also backup code/wp-includes/images//code IF you are using a custom smiley set.
- WordPress 3.0 contains updated files for the classic and default themes as well as the akismet plugin. If you would like the updated files, delete the code/wp-content/themes/default/code, code/wp-content/themes/classic/code, and the code/wp-content/plugins/akismet/code folders. Remember to make a backup of your customisations first!
- Delete all the wordpress files in the root directory where the root codeindex.php/code file is found. DO NOT DELETE codewp-config.php/code (nor any files you may have added yourself: coderobots.txt/code, code.htaccess/code, codefavicon.ico/code).
- Download and extract the new version.
- Upload it to the appropriate folders such as code/wp-admin//code, code/wp-includes//code, and if you deleted the default theme, the classic theme, and the akismet plugin, code/wp-content/themes/classic/code, and the code/wp-content/plugins/akismet/code folders.
- Upload all the files in the root directory.
- If existed, restore code/wp-includes/languages//code directory
Volunteers are assisting with problems on the WordPress Support Forums.
- end of saving for later upgrade
|Language (english, native)||Version (new to old)||Remark|
|Chinese, 简体中文||2.2.1 to 2.2.2, 2.1 to 2.2, 2.1.2 to 2.1.3, 2.1 to 2.1.1, 2.0.7 to 2.0.9, 2.0.6 to 2.0.7, 2.0.5 to 2.0.6, 2.0.4 to 2.0.5|
|Hungarian, magyar nyelv||2.1.2 to 2.1.3, 2.x to 2.1, none specified|
|Italian, italiano||fino alla 2.7, dalla 2.7|
|Korean||1.5.x, 2.0.x to 2.1, 2.0.4 to 2.0.5|
|Spain, Castellano||2.2 to 2.2.1, 2.2.1 to 2.2.2, 2.2.2 to 2.2.3, 2.3 to 2.3.1, 2.3.1 to 2.3.2, 2.3.2 to 2.3.3, 2.3 to 2.5|
|Vietnamese, Việt||2.5 to 2.6|
|Turkish, Türkçe||none specified|
|Russian, Русский||old to new|
|Ukrainian, украї́нська мо́ва||any 2.0.x to 2.3.x, 2.0.5 to 2.0.6|
- 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 ttwp-config/tt. 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 3.0, 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 3.0.