Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

AWS Chicago Summit 2019 - Migrating Microsoft SQL Server to AWS

128 views

Published on

AWS gives you the tools, reliability, and scalability to run SQL Server at a fraction of the cost. But what’s the best path for migration? In this session, we review the pitfalls and benefits of several techniques, including traditional backup and restore, using log shipping to migrate SQL Server 2008–2017 on Amazon EC2 Auto Scaling, using Amazon Database Migration Service to migrate your SQL Server to Amazon RDS, and migrating by way of SQL Server 2017 on Linux. You examine when it makes sense to use Amazon RDS versus EC2, how licensing affects your approach, and how AWS can help you accelerate your migration.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

AWS Chicago Summit 2019 - Migrating Microsoft SQL Server to AWS

  1. 1. S U M M I T CHICAGO
  2. 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Migrating MicrosoftSQLServer to AWS Travis Langhals Director of Cloud Architecture Uturn Data Solutions D E V 0 9
  3. 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Introduction Who am I? 15+ years Microsoft Server experience 6+ years AWS Architecture experience Passionate about Cloud, Automation, and Performance Uturn Data Solutions Advanced Tier AWS Partner Amazon EC2 for Microsoft Windows Server Service Delivery Accreditation Well-Architected Partner
  4. 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Agenda • Why Migrate? • Platform: EC2 vs RDS • Migration Options • High Availability • SQL Server on Linux
  5. 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T WhyMigrate? Reduce Costs • SQL Server Licensing: • $5,000 – $15K per core + 25% SA • SQL Server 2008 End of Support (July 2019) • Hardware, Maintenance, and Facility Costs • Pay as you go Improve Performance & Availability • Multi-AZ High Availability • Scale on Demand: Compute, Storage and Network Innovate • Increase the speed of test and development • Explore new services and platforms
  6. 6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Platform: EC2vsRDS EC2 Virtual Machine with SQL Server machine image or custom install • OS, Patching, and Security managed by Customer • BYOL or License Inclusive • Highly configurable • Read Replica Support (Enterprise only) • Linux Support (SQL 2017) Limitations • High Availability Non-Trivial • BYOL requires Software Assurance RDS AWS Managed Platform with Multi-AZ support • No Configuration, Patching or Updates to manage • S3 Native Backup & Restore • Performance Insights • Automatic Snapshots • AD Integration (Enterprise Directory) Limitations • No Replication, Log Shipping, SSRS/AS/IS • No AlwaysOn Readable Secondary
  7. 7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T MigrationOptions Backup & Restore Log Shipping DMS Replication Complexity Low Medium Medium-High Cutover Time Hours or Days Minutes Seconds Supported Platforms EC2 & RDS EC2 Only EC2 & RDS
  8. 8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Backup & Restore • Simple and well understood process • Upload backups to S3 and assign IAM Role with Options Group • Only full backups supported for RDS (up to 5TB) • No private connectivity required
  9. 9. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Backup & Restore -Configuration Install-Module sqlserver, AWSPowershell | Import-Module # Backup database locally Invoke-SQLBackup –Server SQL2008 –Database AWSSummit ` –File D:MSSQLBackupAWSSummit.bak # Upload backup to S3 Write-S3Object –File D:MSSQLBackupAWSSummit.bak ` –Bucket contoso-migration –Key AWSSummit.bak # Restore database from RDS Invoke-SQLCmd –Server SQL2017 –Command "exec msdb.dbo.rds_restore_database @restore_db_name=‘AWSSummit', @s3_arn_to_restore_from='arn:aws:s3:::contoso-migration/AWSSummit.bak’"
  10. 10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T LogShipping • Migrate SQL Server Editions and Versions while minimal risk and downtime • Minimizes cutover time due to regular incremental Transaction Log restores • Simplified configuration with dbatools (https://dbatools.io/) • VPN or Direct Connect needed to support File Share transfers
  11. 11. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. LogShipping -Configuration Install-Module dbatools Import-Module dbatools $parameters = @{ SourceSqlInstance = 'SQL2008’ Database = 'AWSSummit', 'ReInvent’ DestinationSQLInstance = 'SQL2017' BackupNetworkPath = 'SQL2008LogShipping' CopyDestinationFolder = 'G:MSSQLBackup' GenerateFullBackup = $true } Invoke-DbaLogShipping –Verbose @parameters
  12. 12. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. LogShipping (Reporting)
  13. 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T DMS (DatabaseMigrationServices) • Transactional Replication with low latency • Destination in Read/Write state during migration • Only table schema replicated, additional process needed to sync procs, functions, users, etc. • VPN or Direct Connect needed to allow DMS instance to talk to on- premise database
  14. 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T DMS (TableMapping) { "rules": [ { "rule-type": "selection", "rule-action": "include", "rule-id": "1", "rule-name": "1", "object-locator": { "schema-name": "dbo", "table-name": "*" } }, { "rule-type": "selection", "rule-action": "exclude", "rule-id": "1", "rule-name": "1", "object-locator": { "schema-name": "dbo", "table-name": "*temp*" } }, { "rule-type": "transformation", "rule-id": "101", "rule-name": "101", "rule-target": "table", "object-locator": { "schema-name": "dbo", "table-name": "%" }, "rule-action": "convert-lowercase" } ] }
  15. 15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T DMS (Reporting)
  16. 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T HighAvailability
  17. 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T SQLServer on Linux Why? • Reduce EC2 costs • Consolidate platforms • Easy installation or leverage AWS AMIs • Similar performance to Windows • Active Directory Auth (*Kerberos) Considerations • Always On Limitations (Pacemaker, Listener) • Unsupported: Replication, CDC, SSRS, SSAS, System Extended Stored Proc • Platform Operations • Configuration: /opt/mssql/bin/mssql-conf #/bin/bash sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo sudo yum install -y mssql-server mssql-tools unixODBC-devel sudo /opt/mssql/bin/mssql-conf setup
  18. 18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T SQLServer on Linux (GetStarted) • Systems Manager Automations (Backup and Restore) • https://s3.amazonaws.com/sms- connector/Windows+to+Linux+replatforming+tool+for+Microsoft+SQL+server+databases.pdf • https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-awsec2- sqlserverdbrestore.html ./MigrateSQLServerToEC2Linux.ps1 -SQLServerInstanceName MSSQLSERVER -EC2InstanceId i-024689abcdef -DBNames AdventureDB -PathForBackup D:Backup -AWSRegion us-east-2 -IamInstanceProfileName AmazonEC2RoleForSSM ./MigrateSQLServerToEC2Linux.ps1 -EC2InstanceType m5.large -SubnetId subnet-abc127 -EC2KeyPair customer-ec2-keypair -MigrateAllDBs -PathForBackup D:Backup -AWSRegion us-east-2 –IamInstanceProfileName AmazonEC2RoleForSSM
  19. 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T BestPractices SQL Server on EC2 • Configure AlwaysOn AGs for Production • EBS gp2 volumes may need to be overprovisioned to meet IOPs requirements • Provision separate Data, Log, Temp, and Backup EBS volumes • Use Instance Store for high utilization TempDB SQL Server on RDS • Configure Production instances with Multi-AZ • Use S3 Native Backups and Snapshots • Use Enterprise Directory for Windows Authentication General • Use IaC (CloudFormation or Terraform) to provision all resources • Utilize private subnets and deploy VPN/DC or bastion host for management access • Perform a Well-architected Review
  20. 20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Thank you! S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Travis Langhals tlanghals@uturndata.com www.uturndata.com SlideShare: https://tinyurl.com/sql-aws

×