> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 迁移与现代化

export const PromptBlock = ({children, type, agent, intent, playbookId}) => {
  var utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=prompt-block';
  var tag = 'docs-use-case-gallery';
  var agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  var label = type === 'schedule' ? 'Schedule in Devin' : type === 'playbook' ? 'Create Playbook' : type === 'knowledge' ? 'Add to Knowledge' : agent === 'advanced' ? 'Try in Devin' : agent === 'dana' ? 'Try in Dana' : agent === 'ada' ? 'Try in Ask Devin' : 'Try in Devin';
  var buildUrl = function (text) {
    var encoded = encodeURIComponent(text);
    if (type === 'schedule') return 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + '&prompt=' + encoded;
    if (type === 'playbook') return 'https://app.devin.ai/settings/playbooks/create?' + utm + '&body=' + encoded;
    if (type === 'knowledge') return 'https://app.devin.ai/knowledge?' + utm + '&body=' + encoded;
    if (agent === 'ada') return 'https://app.devin.ai/search?' + utm + '&noSubmit=true&prompt=' + encoded;
    return 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encoded;
  };
  const ref = React.useRef(null);
  const [href, setHref] = React.useState('#');
  React.useEffect(() => {
    if (!ref.current) return;
    var codeEl = ref.current.querySelector('pre code');
    if (codeEl) {
      var text = codeEl.textContent.trim();
      if (text) setHref(buildUrl(text));
    }
    var header = ref.current.querySelector('[data-component-part="code-block-header"]');
    if (header && !header.querySelector('.prompt-block-devin-link')) {
      var link = document.createElement('a');
      link.href = href;
      link.target = '_blank';
      link.rel = 'noopener noreferrer';
      link.className = 'prompt-block-devin-link';
      link.style.cssText = 'display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:#fff;font-size:11px;font-weight:500;padding:4px 10px;border-radius:6px;white-space:nowrap;background:#317CFF;transition:background 0.2s;margin-left:8px;';
      link.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg> ' + label;
      link.onmouseenter = function () {
        link.style.background = '#2968D9';
      };
      link.onmouseleave = function () {
        link.style.background = '#317CFF';
      };
      header.appendChild(link);
    }
    var existingLink = ref.current.querySelector('.prompt-block-devin-link');
    if (existingLink && href !== '#') existingLink.href = href;
  });
  return <div className="prompt-block" ref={ref}>{children}</div>;
};

<div id="overview">
  ## 概览
</div>

Devin 可以大大减轻迁移工作的负担，帮助你在不同框架、语言等之间进行迁移。使用 [playbooks](/zh/product-guides/creating-playbooks) 来轻松复用适用于大型迁移的提示。

<div id="use-cases">
  ## 使用场景
</div>

1. 语言迁移（例如 JavaScript 到 TypeScript）
2. 框架升级（例如 React 17 到 18）
3. 数据库迁移
4. 依赖项更新
5. 架构现代化

<div id="example-prompts">
  ## 示例提示
</div>

<AccordionGroup>
  <Accordion title="Java 7 升级到 Java 8" icon="circle-up">
    <PromptBlock>
      ```txt Java upgrade theme={null}
      ## 概览
      本操作手册提供将 Java 7 项目升级到 Java 8 的分步说明。

      ## 步骤
      1. 确认该项目当前确实使用 Java 7
      2. 安装 Java 8 开发工具包 (JDK)
      3. 更新项目的构建配置
      4. 识别并替换已弃用的 Java 7 API
      5. 分析代码库，识别可利用 Java 8 的优化点
      6. 更新单元测试
      7. 执行全面测试
      8. 更新文档
      9. 构建并验证应用程序

      ## 建议与技巧
      - 查阅 Java 8 文档以获取新特性和 API 的详细信息
      - 对于大规模迁移，可考虑使用 [API Reference](/api-reference/overview) 并行运行多个迁移会话
      ```
    </PromptBlock>
  </Accordion>

  <Accordion title="TypeScript 迁移" icon="code">
    <PromptBlock>
      ```txt TypeScript migration theme={null}
      请帮助将我们的 JavaScript 项目迁移到 TypeScript。我们需要：
      1. 添加 TypeScript 配置
      2. 将 .js 文件转换为 .ts
      3. 添加合适的类型定义
      4. 更新构建流程
      5. 确保所有测试仍然通过
      ```
    </PromptBlock>
  </Accordion>
</AccordionGroup>

<div id="example-session">
  ## 示例会话
</div>

<div id="csv-to-notion-bulk-migration">
  ### 将 CSV 批量迁移到 Notion
</div>

在这个示例会话中，Devin 帮助用户将数据从 CSV 文件批量迁移到 Notion。

[https://app.devin.ai/sessions/583736c03c174c92884aad7ada325fe2](https://app.devin.ai/sessions/583736c03c174c92884aad7ada325fe2)
