【问题标题】:Moving 3 year old Wordpress site to new server将 3 年前的 Wordpress 网站移至新服务器
【发布时间】:2012-12-10 14:03:16
【问题描述】:

我受命将 2010 年制作的 Wordpress 网站移至新服务器。我无法访问旧网站的管理面板,但已获得源文件和数据库的导出版本。该网站安装了许多插件,我认为通过全新安装传输所有旧文件等会更加困难,因此我想让旧网站正常工作。

我已将所有文件复制到我的测试服务器中,并对 wp_config.php 文件进行了更改以找到新的数据库位置。问题是所有链接似乎都来自旧网站。从逻辑上讲,我假设我需要更改绝对路径,然后更改各个帖子的链接。

我在哪里更改这些值,是否需要更改任何其他文件/值以确保网站完美运行?

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    您会看到很多不同的方法(迁移脚本/插件、导出/导入等)。我在这里假设您的问题源于更改站点运行的域,这与更改服务器不同?。

    对我来说,转移 Wordpress 网站的最佳方式是使用我在此处给出的以下答案 - Interconnectit 脚本可以节省大量时间和麻烦。

    How to push wordpress from mamp into hostgator

    【讨论】:

      【解决方案2】:

      通常在你的 wp-config.php 中这样做:

      define('WP_SITEURL', 'http://new-path.com');
      define('WP_HOME', 'http://new-path.com');
      

      如果这还不够,请添加一个名为“搜索和替换”的插件,然后搜索旧网址,然后用新网址替换。

      【讨论】:

      • 嘿忍者,这些定义不在这个 wp_config 中,可能是一个非常旧的 wordpress 版本(版本 3.1.4)
      • 您可以自己添加它们,如果您不使用 WP 2.0 或更低版本,应该支持它。
      【解决方案3】:

      以下方法对我有用。主题也正确迁移。

      如何将 Wordpress 安装程序从一台服务器移动到另一台服务器(使用不同的域名)

      1.Export Files & DB from the source server.
      2.Import Files & DB into the target server (As it is)
      3.Delete *_options table from the target server DB.
      4.Export only the *_options table from the source server DB.
      5.Find & Replace the old domain name with the new domain name in the above .sql file
      6.Import the above modified *_options table into target server DB.
      7.Open wp-config.php file in target server and update the new DB connection info.
      8.Open .htaccess file in target server and put the default entry for WordPress.
      9.Login into the target server WP Admin Panel
      10.Install and activate a plugin called “Velvet Blues Update URLs”.
      11.Go to Tools -> Update URLs
      12.Replace all the following possible URLs with the new domain name
      
      http://www.example.com
      https://www.example.com
      http://example.com
      https://example.com
      
      13.Test the target server site
      

      【讨论】:

        猜你喜欢
        • 2023-03-08
        • 1970-01-01
        • 2016-07-26
        • 2013-02-23
        • 1970-01-01
        • 1970-01-01
        • 2015-03-05
        • 1970-01-01
        • 2015-05-05
        相关资源
        最近更新 更多