站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Moving WordPress
”
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
Xxf3325
(
讨论
|
贡献
)
2008年4月23日 (三) 10:21的版本
(新页面: __TOC__ There are times when you need to move WordPress around within your server, and times when you need to move WordPress from one server to another. You don't need to reinstall. WordP...)
(差异) ←上一版本 |
最后版本
(
差异
) |
下一版本→
(
差异
)
跳转至:
导航
、
搜索
警告:您正在编辑的是本页面的旧版本。
如果您发布该更改,该版本后的所有更改都会丢失。
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
__TOC__ There are times when you need to move WordPress around within your server, and times when you need to move WordPress from one server to another. You don't need to reinstall. WordPress is flexible enough to handle all of these situations. Easy answer for most installations: * If database and URL remains the same, you can move by just copying your files and database. * If database name or user changes, edit wp-config.php to have the correct values. * If you want to '''test before you switch''', you must temporarily change "siteurl" and "home" in the database table "wp_options" (through phpMyAdmin or similar).<br />If you had any kind of rewrites (permalinks) setup you must disable .htaccess and reconfigure permalinks when it goes live. ==Moving WordPress Within Your Site== Moving the WordPress files from one location on your server to another - changing its URL - requires some special care. Here are the step-by-step instructions: # Create the new location using one of these two options: ## If you will be moving your [[WordPress:WordPress Files|WordPress core files]] to a new directory, create the new directory. ## If you want to move WordPress to your root directory, make sure all [[WordPress:WordPress Files|index.php]], [[WordPress:Glossary#.htaccess|.htaccess]], and other files that might be copied over are backed up and/or moved, and that the root directory is ready for the new WordPress files. # Login to your blog. # Go to the [[WordPress:Administration Panels|Administration]] > [[WordPress:Administration_Panels#Options_-_Configuration_Settings|Settings]] > [[WordPress:Settings_General_SubPanel|General]] panel. # In the box for '''WordPress address (URI):''' change the address to the new location of your main WordPress core files. # In the box for '''Blog address (URI):''' change the address to the new location, which should match the WordPress address (URI). # Click '''Update Options'''. # (Do not try to open/view your blog now!) # ''WordPress 2.0 only:'' Delete the folder ''wp-content/cache''. # Move your WordPress core files to the new location. This includes the files found within the original directory, such as <tt><nowiki> http://example.com/wordpress</nowiki></tt>, and all the sub-directories, to the new location. # If you are using [[WordPress:Using Permalinks|Permalinks]], go to the [[WordPress:Administration Panels|Administration]] > [[WordPress:Administration_Panels#Options_-_Configuration_Settings|Settings]] > [[WordPress:Settings_Permalinks_SubPanel|Permalinks]] panel and update your Permalink structure to your [[WordPress:Glossary#.htaccess|.htaccess]] file, which should be in the same directory as the main <tt>index.php</tt> file. # If you have problems with missing images that you've uploaded, you need to change the path to the images on every post directly on your SQL database. For this, follow the instructions on [http://www.tamba2.org.uk/wordpress/move3 Tamba2's Tutorial "Moving your weblog inside your PC"]. It is important that you set the URI locations BEFORE you move the files. Suppose you accidentally moved the files before you changed the URIs. Suppose the files were originally in /path/to/old/ and you moved them to /path/to/new before changing the URIs. The way to fix this would be to make /path/to/old/ a symlink (for Windows users, "symlink" is equivalent to "shortcut") to /path/to/new/, i.e. <pre>ln -s /path/to/new /path/to/old</pre> and then follow the steps [[WordPress:Moving WordPress#Moving WordPress Within Your Site | above]] as normal. Afterwards delete the symlink if you want. You're done. Test your site to make sure that it works right. If the change involves a new address for your blog, make sure you let people know the new address, and consider adding some redirection instructions in your <tt>.htaccess</tt> file to guide visitors to the new location. == Giving WordPress its Own Directory While Leaving the WordPress Index File in the Root Directory== Please see this article, [[WordPress:Giving_WordPress_Its_Own_Directory|Giving WordPress Its Own Directory]], for detailed instructions. ==Moving WordPress to a New Server== If you are moving WordPress from one server to another, begin by backing up your data. This includes backing up your WordPress database as well as all the core files, images, plugins, and other files on your site. See [[WordPress:WordPress Backups]] and [[WordPress:Backing Up Your Database]] for more details. *Note: If you are changing to a new server but same domain, all you need to do is edit wp-config.php and upload everything as it is to your new server. '''If You Don't Care If Your Old Blog Works''' #Download a copy of the main wordpress files from your OLD blog to your hard drive and edit wp-config.php to suit the new server. #Go back to your OLD blog and go to options and change the url (both of them) to that of your new site. #Again, download your database (but keep the old one just in case), upload this new database and the copy of the wordpress core files with the edited wp-config.php to your new server. Thats it! '''If You Want Your Old Blog To Still Work''' Caution: Make sure you have a backup of your old blog's WordPress database before proceeding! ''Part A - Activating Your New Blog'' #Download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your OLD blog's installation. #Go back to your OLD blog and go to options and change the url (both of them) to that of your new site. #Again, download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your NEW blog's installation. #Download your database once again (but keep the old one). Upload this database to your new server. It will be easiest if you use the same database name and you create a user with the same login credentials on your new server as on your old server. #If you used a different database name and/or user (see previous step), edit wp-config.php in your NEW blog's installation folder appropriately. #Upload the NEW blog's installation folder to your new site. Presto, your NEW blog should be working! ''Part B - Restoring Your Old Blog'' #On the original server, delete your OLD blog's database (remember, you should have a copy on your local computer that you made at the very beginning). #Upload your OLD blog's installation folder to your original server, overwriting the files that are currently there (you may also delete the installation folder on the server and simply re-upload the OLD blog's files). #Upload your OLD blog's database from your local computer to the server. That should do it! Another procedure for making copies of posts, comments, pages, categories and custom field (post status, data, permalinks, ping status...) easy to follow: #Install a new Wordpress blog #Go on old blog Admin panel. Here, in Manage > Export select "all" in menu Restrict Author. #Click on Download Export File #In new blog go on Manage > Import, choose Wordpress item. #In the page that will be shown, select the file just exported. Click on Upload file and Import #It will appear a page. In Assign Authors, assign the author to users that already exist or create new ones. #Click on Submit #At the end, click on Have fun Note: using this method if there are some articles in new blog (like hello world, info page...), these will not be erased. Articles are only added. Using the former procedure the article in new blog will be deleted. ==Moving WordPress to a New Server with Fantastico== Some webhosts use a service called [http://netenberg.com/fantastico.php Fantastico], which can install a vanilla WordPress web with just a few clicks. You can transfer your blog to one of these webs, but the steps are slightly different. Begin by backing up your data. This includes backing up your WordPress database as well as all the core files, images, plugins, and other files on your site. See [[WordPress:WordPress Backups]] and [[WordPress:Backing Up Your Database]] for more details. '''Make a copy of your database. You will need to edit the <code>.sql</code> file, and in case of errors, it is important that you work on a copy.''' Begin the process of working from copies of your backups. #'''If''' you have changed domain, edit the backed up database file to reflect this. A simple way to do this is: ## Using a [[WordPress:Glossary#Text editor|text editor]], open a '''copy''' of the <code>.sql</code> database file. ## Using the search and replace function, find all instances of the blog's old [[WordPress:Glossary#URL|URL]] and replace it with the new URL. ## Repeat the process with your old email address. (For example, replacing <tt>someone@example.com</tt> with <tt>someone@tutorial.com</tt>) ## Save your changes. #Upload your plugins and themes from your old site to the new one. #Drop (delete) the database tables of the pre-installed Fantastico web. #[[WordPress:Restoring Your Database From Backup|Restore the database]]. When you are ready to check your site, make sure to [[WordPress:I Make Changes and Nothing Happens|clear your cache]] and cookies so you will see the changes in your web browser. == Additional Information == * [http://www.tamba2.org.uk/wordpress/ Podz' WordPress Guides] * [http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/ How to move WordPress to a new domain or location] * Italian version of this article - [http://www.valent-blog.eu/2007/09/14/trasferire-wordpress/ Versione italiana dell'articolo] * German version of this article - [http://blogs-optimieren.de/2008/01/13/wordpress-korrekt-umziehen/] {{Copyedit}}
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
模板:Copyedit
(
编辑
)
模板:WordPress导航
(
查看源代码
)(受保护)