简体   繁体   English

AWS - DMS 迁移缺少序列、视图、例程...等

[英]AWS - DMS migration missing sequence , views , routines ... etc

I a trying to do the migration for our Postgres database to Aurora postgres first I create a normal task it migrates all tables only except its constraints.我尝试将我们的 Postgres 数据库迁移到 Aurora postgres,首先我创建了一个正常任务,它只迁移所有表,除了它的约束。

My tries to clone our database我尝试克隆我们的数据库

I downloaded AWS SCT (Schema Conversion Tool) then set my configuration to generate a migration report, here is the report我下载了 AWS SCT (Schema Conversion Tool) 然后设置我的配置以生成迁移报告,这是报告

We completed the analysis of your PostgreSQL source database and estimate that 100% of the database storage objects and 99.1% of database code objects can be converted automatically or with minimal changes if you select Amazon Aurora (PostgreSQL compatible) as your migration target.我们完成了对您的 PostgreSQL 源数据库的分析,并估计如果您选择 Amazon Aurora(兼容 PostgreSQL)作为迁移目标,100% 的数据库存储对象和 99.1% 的数据库代码对象可以自动转换或只需极少的更改。 Database storage objects include schemas, tables, table constraints, indexes, types, sequences and foreign tables.数据库存储对象包括模式、表、表约束、索引、类型、序列和外部表。 Database code objects include triggers, views, materialized views, functions, domains, rules, operators, collations, fts configurations, fts dictionaries and aggregates.数据库代码对象包括触发器、视图、物化视图、函数、域、规则、运算符、排序规则、fts 配置、fts 字典和聚合。 Based on the source code syntax analysis, we estimate 99.9% (based on # lines of code) of your code can be converted to Amazon Aurora (PostgreSQL compatible) automatically.根据源代码语法分析,我们估计您的代码中有 99.9%(基于 # 行代码)可以自动转换为 Amazon Aurora(兼容 PostgreSQL)。 To complete the migration, we recommend 133 conversion action(s) ranging from simple tasks to medium-complexity actions to complex conversion actions.为了完成迁移,我们建议 133 项转化操作,从简单的任务到中等复杂度的操作再到复杂的转化操作。

my question:我的问题:

1- is there a way to automate including everything in my source database 1-有没有办法自动化包括我的源数据库中的所有内容

2- the report mentions we recommend 133 conversion action(s) where I can find these conversion actions. 2- 报告提到we recommend 133 conversion action(s) ,我可以在其中找到这些转化操作。

3- is it safe to ongoing migration as in my case we need to run migration every day. 3-持续迁移是否安全,因为在我的情况下,我们需要每天运行迁移。

  • There's no way AFAIK in AWS to automate everything if that was there then it would have been already added in SCT. AWS 中的 AFAIK 无法自动执行所有操作,如果存在,那么它已经添加到 SCT 中。 however, if there are similar errors that are occurring in code/DDL/function like some datatype conversions.但是,如果代码/DDL/函数中发生类似的错误,例如某些数据类型转换。 you can create a script that will take schema dump and convert all these data types to the desired ones.您可以创建一个脚本,该脚本将进行模式转储并将所有这些数据类型转换为所需的数据类型。

  • Choose the SQL Conversion Actions tab in SCT tool.SCT 工具中选择 SQL Conversion Actions 选项卡。 The SQL Conversion Actions tab contains a list of SQL code items that can't be converted automatically. SQL Conversion Actions 选项卡包含无法自动转换的 SQL 代码项的列表。 There are also recommendations for how to manually convert the SQL code.还有关于如何手动转换 SQL 代码的建议。 You can look into the errors and make changes accordingly.您可以查看错误并进行相应的更改。

In case if you are migrating to the same version of PG in aurora you can take a schema only dump and restore it into target aurora and later setup a full load/ongoing replication with DMS and you don't have to take SCT into consideration(most of the time worked for me).如果您在 aurora 中迁移到相同版本的 PG,您可以只使用模式转储并将其恢复到目标 aurora,然后使用 DMS 设置完全加载/持续复制,您不必考虑 SCT(大部分时间为我工作)。 Just make sure you adhere to aurora limitations specific to the PG version只需确保您遵守特定于 PG 版本的极光限制

  • We have been using ongoing migration in our project at it's working great.我们一直在我们的项目中使用正在进行的迁移,它运行良好。 There are some best practices we have developed but that will differ from project to project我们已经开发了一些最佳实践,但会因项目而异

    1. DDL changes must be made on the target first and stop replication while doing it and resume once done必须首先在目标上进行 DDL 更改,并在执行时停止复制并在完成后恢复
    2. Separate the tables with high transactions as different DMS task as it will help you in troubleshooting and your rest of the tables can still be working将具有高事务的表分隔为不同的 DMS 任务,因为这将帮助您进行故障排除,并且您的其余表仍然可以工作
    3. Always keep in mind DMS replicates data, not the view/function/procedures始终牢记 DMS 复制数据,而不是视图/功能/过程
    4. Active monitoring of tasks and replication instances主动监控任务和复制实例

And I would like to suggest if you are performing homogenous migration(PG -> PG) you should consider pg_dump & pg_restore that easy and sophisticated for the same versions and AWS aurora supports it.我想建议如果您正在执行同构迁移(PG -> PG),您应该考虑 pg_dump 和 pg_restore 对于相同的版本来说简单而复杂,并且AWS aurora支持它。

Sequence、Index 和 Constraint 不迁移,AWS 官方文档中提到了。

你可以使用这个来源<\/a>。这将帮助您一次迁移序列、索引和约束。

ps:这不包括视图和例程。

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM