【问题标题】:Drupal 6 To 7 MigrationDrupal 6 到 7 迁移
【发布时间】:2011-10-17 13:17:51
【问题描述】:

我们有一个用 drupal 6 编写的 drupal 站点。我们知道我们必须为 drupal 7 重写它(大部分)

但重要的是迁移数据。 CCK migrate 只能迁移大约 90% 的字段。

我正在寻找一种将 drupal 6 数据迁移到 drupal 7 的干净方法。

我们使用 content_multigroup 作为一个模块,它基本上就像一个字段集合...如何迁移?

我正在寻找一些通用策略...我正在考虑引导 drupal 7,只针对 drupal 6 数据库编写查询并保存节点。

【问题讨论】:

    标签: drupal-6 drupal-7


    【解决方案1】:

    自从提出这个问题以来,Migrate 模块已经发展了很多。此外,Migrate D2D module 是从 Drupal 6 迁移到 Drupal 7 的一个很好的起点。

    检查documentation,你应该对如何去做有一个很好的了解。

    诚然,Migrate 模块似乎有一个陡峭的学习曲线,但使用 Migrate D2D 示例您应该足够快地上手。

    【讨论】:

      【解决方案2】:

      将 Drupal6 升级到 Drupal7

      对所有文件、目录和数据库进行完整备份

      *注: 在将站点的测试副本应用于您的实时站点之前,尝试对其进行更新或升级是明智的。即使是很小的更新也可能导致您网站的行为发生变化。

      第 1 步:

      Make note of non-core drupal modules(no need drupal core modules) and search if that all modules are available in drupal 7. If the modules are not available, then search “is there any alternate module for drupal 7”. Make sure of it. (*step 1 is important)
      

      第 2 步:

      Disable all non-core module. 
      
      Drush:      drush pm-disable `drush pm-list --no-core --type=module –pipe`
      

      第 3 步:

      Change the default theme as “Garland”.
      
      Drush:      drush vset theme_default garland, drush vset admin_theme garland
      

      第 4 步:

      Update the drupal6.
      
      Drush:      drush up drupal
      

      第 5 步:

      Dump the DataBase.
      
      Drush:      drush sql-dump > /path-to-dump/my-sql-dump-file-name.sql
      Terminal:   mysqldump -u [username] -p [database name] > [database name].sql
      

      第 6 步:

      Download the latest Drupal7.
      
      Drush:      drush dl drupal --select`option to select the version`
      

      第 7 步:

      Copy “files” folder from old instance(Drupal6) to new instance(Drupal7) and change the folder permissions.
      

      第 8 步:

      Import the dumped DB to new instance.
      
      Drush:  (drush sql-drop, drush sql-cli < /path-of-dump/my-sql-dump-file-name.sql)
      Terminal:   mysql -u [username] -p newdatabase < [database name].sql
      

      第 9 步:

      Go to Drupal Root > sites > default > settings.php and change into $update_free_access to TRUE in the settings file and then run update.php.
      

      第 10 步:

      Download all the contributed modules : include `views and views related modules`.  
      

      第 11 步:

      Must download Content Construction Kit (CCK) module. Enable the CCK, Content Migrate modules.
      
      Drush:      drush dl cck, drush en cck
      
      Go to “Admin-Structure > Migrate fields”.
      

      第 12 步:

      In that Migrate fields,
      
      
      
      After enable click “Migrate fields” in “Available fields” the fields are come under the “Converted Fields”. Once again run “update.php”.
      

      *参考:https://drupal.org/update/themes/6/7

      【讨论】:

        【解决方案3】:

        你看过http://drupal.org/project/feeds(因为它的名字,它经常被忽视,因为它非常适合用作数据迁移工具)?

        你在处理什么样的字段?

        如果失败,并且由于您正在寻找通用策略,我会说以下内容:我鼓励您尽可能使用 API,而不是直接查询。

        根据我自己的经验,在两个选项之间进行选择:

        a) 在 D6 下运行脚本并通过 SQL 推送到 D7 DB 或者 b) 让脚本在 D7 下运行并通过 SQL 拉到 D6 DB

        我会选择 b) 以确保 node_save 最终能够完成所有工作。

        【讨论】:

          猜你喜欢
          • 2023-03-23
          • 1970-01-01
          • 2023-03-25
          • 2015-10-26
          • 2018-10-13
          • 1970-01-01
          • 1970-01-01
          • 2015-04-02
          • 2019-04-15
          相关资源
          最近更新 更多