{"id":174,"date":"2017-06-26T00:00:00","date_gmt":"2013-01-01T00:00:00","guid":{"rendered":"https:\/\/www.sqlhammer.com\/aws-database-migration-service"},"modified":"2026-03-18T21:52:57","modified_gmt":"2026-03-18T21:52:57","slug":"aws-database-migration-service","status":"publish","type":"post","link":"https:\/\/sqlhammer.com\/index.php\/2017\/06\/26\/aws-database-migration-service\/","title":{"rendered":"AWS Database Migration Service &#8211; SQL Hammer"},"content":{"rendered":"<p>I have begun writing a few blog posts focused on launching your databases into the cloud. Specifically targeted on database migration methodologies. Choosing a migration method involves making a lot of decisions up-front. This post will assume that Managed Relational Database Service (RDS), which is a Platform as a Service offering by Amazon Web Services (AWS), has been chosen. Also, this post will focus on a homogeneous database migration between an on-premises Microsoft SQL Server database and a SQL Server database on RDS.<\/p>\n<h2>How to use Database Migration Service<\/h2>\n<p>The AWS Database Migration Service (DMS) aids in migrating databases from several different data platforms to Amazon EC2, Amazon RDS, and Amazon Redshift instances. It can be setup to copy your database in a single full load or load and continue to replicate changes, keeping the target database up-to-date.<\/p>\n<p>Setting up DMS is simple. The architecture is comprised of, the source database, the target database, an endpoint for each database, and a replication instance.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/aws-dms-diagram-1\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C174&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/aws-dms-diagram-1.png?resize=645%2C174&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>This walk through is going to start with an on-premises Microsoft SQL Server already in existence and no AWS resources instantiated, yet.<\/p>\n<h3>Building a SQL Server database in Amazon RDS<\/h3>\n<p>There are many sizing and parameter decisions to make when creating an Amazon RDS database. For the purposes of this demonstration the <a href=\"https:\/\/aws.amazon.com\/free\/\">AWS Free Tier<\/a> will be used. The free tier limits some of the choices but this is not a problem because the focus of the article is DMS, not the intricates of RDS.<\/p>\n<p>Begin building the database by logging into the AWS console. Search for and select RDS.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/ms-rds-1\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=616%2C257&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/ms-rds-1.png?resize=616%2C257&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>Select <em>Instances<\/em> and then <em>Launch DB Instance.<\/em><\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/ms-rds-2\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=527%2C232&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/ms-rds-2.png?resize=527%2C232&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>Select Microsoft SQL Server Express.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/ms-rds-3\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C457&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/ms-rds-3.png?resize=645%2C457&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>Configure the database according to performance and size needs. Given that this demonstration is in the free tier, db.t2.micro is selected with the included, and free, SQL Server Express license. I was impressed to see SSD storage in the free tier.<\/p>\n<p>Define a unique database instance identifier and the initial SQL authentication account.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/ms-rds-4\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C554&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/ms-rds-4.png?resize=645%2C554&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>Clicking next will bring up the networking and instance configuration options. Ensure that the instance is publicly accessible and allow the wizard to create a new security group. Leave the rest of the options default and click <em>Launch DB Instance<\/em>.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/ms-rds-5\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C649&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/ms-rds-5.png?resize=645%2C649&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>AWS can take up to 20 minutes to provision a new database instance. Given how small this instance is, it takes closer to 5 minutes. The instance cannot be connected to until its status is <em>available<\/em>. The endpoint information is listed when the instance is selected in the console.<a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/ms-rds-7\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C249&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i2.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/ms-rds-7.png?resize=645%2C249&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<h3>Configuring network security<\/h3>\n<p>While the instance builds, move on to setting up the <a href=\"https:\/\/aws.amazon.com\/vpc\/\">virtual private cloud<\/a> (VPC) <a href=\"http:\/\/docs.aws.amazon.com\/AmazonVPC\/latest\/UserGuide\/VPC_SecurityGroups.html\">security group<\/a>. Navigate back to the AWS console and search for VPC.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/network-1\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=523%2C268&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i2.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/network-1.png?resize=523%2C268&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>Once at the VPC dashboard, go to <em>Security Groups<\/em>, select the group created by the RDS wizard, and create a new inbound rule. In the screenshot below, I have added a rule for my home network\u2019s public IP address. It is also possible to create a rule for 0.0.0.0\/0 which opens up all TCP traffic. Later in this post, a rule will need to be created to allow the DMS replication instance to connect.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/network-2\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C404&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i2.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/network-2.png?resize=645%2C404&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<h3>Setting up the Database Migration Service<\/h3>\n<p>Once again, from the AWS console, search for and select DMS.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/dms-1\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=545%2C261&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/dms-1.png?resize=545%2C261&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>Click on <em>Get Started<\/em>.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/dms-2\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=525%2C363&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/dms-2.png?resize=525%2C363&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>Like most wizards in the world, this one begins with a welcome page. One important piece of information that is provided, however, is the tip about using the <a href=\"http:\/\/docs.aws.amazon.com\/SchemaConversionTool\/latest\/userguide\/Welcome.html\">AWS Schema Conversion Tool<\/a>. The conversion tool is most useful for heterogeneous migrations, such as Oracle to RDS Microsoft SQL Server. This demonstration is using homogeneous data platforms; therefore, it is not needed.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/dms-3\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C295&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/dms-3.png?resize=645%2C295&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>Leave most of the replication instance choices default. A name and description is required. Then, expand the advanced section.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/dms-4\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C355&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/dms-4.png?resize=645%2C355&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>In the advanced section, select the security group that was used to create the RDS instance. This will make connectivity a little bit easier. Then, click next to move on.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/dms-4-5\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C337&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i2.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/dms-4.5.png?resize=645%2C337&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>The replication instance will begin to build at this time. Populate the endpoint information for the source and destination connections. The endpoints to each will need to pass a connection test, located at the bottom of the page. The tests are not available until the replication instance is built, however.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/dms-5\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C484&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/dms-5.png?resize=645%2C484&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>The next, and final, page defines the replication task. This demonstration is going to focus on a single full load of the database into RDS. Allowing DMS to configure SQL Server Transactional Replication for on-going data updates, is also an option.<\/p>\n<p>If there is LOB data in the database, make sure to select <em>Full LOB mode<\/em> to avoid truncation of data. In <em>Limited LOB mode<\/em>, default, DMS will truncate all LOB values to the maximum bytes which is configured.<\/p>\n<p>I highly recommend enabling logging. DMS works well and is reliable but, if there are any problems, the log becomes invaluable for troubleshooting.<\/p>\n<p>Finally, there must be at least one inclusion rule. If the entire database is to be migrated, the rule can have a wild card (%) in both the schema and table name fields. Multiple rules can be created to cover only the objects that are desired to be included in the migration.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/dms-7\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C664&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i2.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/dms-7.png?resize=645%2C664&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>After clicking <em>create task<\/em>, the task will begin to build. Selecting the task and navigating to the <em>logs<\/em> tab will present a link to Cloud Watch and the log stream. If you did not create a security rule for TCP 0.0.0.0\/0, earlier in this process, then you will need to navigate to the <em>replication instances<\/em> page. Record the IP address so it can be added as a new security rule in your security group.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/dms-8\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C276&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i2.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/dms-8.png?resize=645%2C276&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<p>In addition to the logs, the replication status can easily be viewed in the <em>table statistics<\/em> tab and the high-level status columns in-line with the task selector.<\/p>\n<p><a href=\"https:\/\/sqlhammer.com\/aws-database-migration-service\/dms-9\/\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/plugins\/a3-lazy-load\/assets\/images\/lazy_placeholder.gif?resize=645%2C309&#038;ssl=1\" alt=\"\" \/><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.sqlhammer.com\/wp-content\/uploads\/2017\/06\/dms-9.png?resize=645%2C309&#038;ssl=1\" alt=\"\" \/><\/a><\/p>\n<h2>Wrap-up<\/h2>\n<p>Once all of the tables are completed, the full load is done. The hardest part of this process is connecting the replication instance to the source and destination and that is not difficult at all. All of the synchronization process is handled behind the scenes. It is one of the easiest methods that I know of for migrating an on-premises database into a PaaS database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have begun writing a few blog posts focused on launching your databases into the cloud. Specifically targeted on database migration methodologies. Choosing a migration method involves making a lot of decisions up-front. This post will assume that Managed Relational Database Service (RDS), which is a Platform as a Service offering by Amazon Web Services [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-174","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts\/174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/comments?post=174"}],"version-history":[{"count":1,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":436,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts\/174\/revisions\/436"}],"wp:attachment":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/media?parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/categories?post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/tags?post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}