Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      Handling JavaScript Event Listeners With Parameters

      July 21, 2025

      I finally gave NotebookLM my full attention – and it really is a total game changer

      July 22, 2025

      Google Chrome for iOS now lets you switch between personal and work accounts

      July 22, 2025

      How the Trump administration changed AI: A timeline

      July 22, 2025

      Download your photos before AT&T shuts down its cloud storage service permanently

      July 22, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Laravel Live Denmark

      July 22, 2025
      Recent

      Laravel Live Denmark

      July 22, 2025

      The July 2025 Laravel Worldwide Meetup is Today

      July 22, 2025

      Livewire Security Vulnerability

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
      Recent

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025

      Halo and Half-Life combine in wild new mod, bringing two of my favorite games together in one — here’s how to play, and how it works

      July 22, 2025

      Surprise! The iconic Roblox ‘oof’ sound is back — the beloved meme makes “a comeback so good it hurts” after three years of licensing issues

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Databases»Migrate SQL Server user databases from Amazon EC2 to Amazon RDS Custom using Amazon EBS snapshots

    Migrate SQL Server user databases from Amazon EC2 to Amazon RDS Custom using Amazon EBS snapshots

    April 21, 2025

    Amazon Relational Database Service (Amazon RDS) Custom for SQL Server is a managed database service that allows customization of the underlying operating system and includes the ability to bring your own licensed SQL Server media or use SQL Server Developer Edition while providing the time-savings, durability, and scalability benefits of a managed database service. In this post, we present a practical approach to one of the most significant challenges organizations face when adopting RDS Custom: migrating large datasets from SQL Server on Amazon Elastic Compute Cloud (Amazon EC2) to Amazon RDS Custom for SQL Server efficiently and cost-effectively.

    This post describes a tailored lift-and-shift strategy that leverages RDS Custom’s unique capabilities to simplify your database migration. By using SQL Server’s native detach and attach method combined with EBS snapshots, you can migrate your databases without requiring Amazon Simple Storage Service (Amazon S3) or AWS Database Migration Service (AWS DMS). Our tested approach provides a seamless transition path that emphasizes both efficiency and speed.

    Organizations can use this solution to simplify complex data migrations while minimizing business disruption. We provide detailed steps, practical insights, and best practices to help you successfully migrate your SQL Server databases from EC2 to RDS Custom. This approach helps you maintain data integrity and take full advantage of RDS Custom’s managed database capabilities.

    Solution overview

    The migration process uses AWS native tools to maintain data integrity and minimize downtime. The complete process follows these steps:

    1. Create an EBS snapshot of your SQL Server database volume on the EC2 instance.
    2. Restore the snapshot to a new EBS volume.
    3. Pause RDS Custom automation to allow manual configuration.
    4. Attach the new EBS volume to your RDS Custom host instance.
    5. Connect to the RDS Custom for SQL Server host and copy the database files from the attached EBS volume to the D drive of RDS SQL Server Custom Instance.
    6. Attach the databases to RDS Custom SQL Server instance to complete the migration.
    7. After the migration, clean up by detaching the temporary volume and resuming RDS Custom automation.

    This methodology offers several advantages:

    • Database migration with minimal downtime
    • Minimizes operational disruptions
    • Maintains data integrity throughout the process
    • Provides a seamless transition from a self-managed EC2 instance to the RDS Custom for SQL Server platform

    By adhering to this procedure, organizations can efficiently migrate their SQL Server databases while potentially enhancing performance, reliability, and manageability of their database workloads. This approach exemplifies a strategic shift from self-managed infrastructure to a more optimized, managed database environment.

    Prerequisites

    To implement this solution, you need to complete the following prerequisite steps:

    1. Create an EC2 instance with an EBS volume.
    2. Create a RDS Custom for SQL Server instance.
    3. The target SQL Server version should be equal to or higher than the source EC2 SQL Server version.

    Note: Review the AWS Documentation for supported regions and DB Engines for RDS Custom for SQL Server. Make sure you consider Database edition compatibility for the migration.

    For this post, we migrate from SQL Server 2022 Standard Edition running on EC2 to RDS Custom for SQL Server 2022 Standard Edition.

    Create a snapshot of the EBS volume

    Complete the following steps to create a snapshot of the EBS volume that stores your databases:

    Note: Stop all incoming write traffic to EC2 SQL Server to ensure a consistent snapshot.

    1. On the Amazon EC2 console, in the navigation pane, choose Volumes.
    2. Select your EBS volume, and on the Actions menu, choose Create snapshot.
    3. Add a description and then choose Create snapshot.

    Create a volume from the EBS snapshot

    Once the snapshot is created, complete the following steps:

    1. On the Amazon EC2 console, in the navigation pane, choose Snapshots.
    2. Select the snapshot you created, and on the Actions menu, choose Create volume from snapshot.
    3. Select your desired volume settings. You must select the Availability Zone that is the same Availability Zone that your RDS Custom for SQL Server DB instance is in. Select the primary Availability Zone in case the RDS Instance is in a Multi-AZ deployment.
    4. Choose Create volume. Note down the newly created EBS Volume name for later use.

    Pause automation

    This step is necessary prior to the migration. Pause the RDS Custom automation.

    Attach the restored volume to the RDS Custom for SQL Server EC2 host instance

    Complete the following steps to carry out the migration by attaching the newly restored EBS volume to the RDS Custom for SQL Server underlying EC2 host instance.

    1. On the Amazon EC2 console, in the navigation pane, choose Volumes.
    2. Select your previously noted EBS volume, and on the Actions menu, choose Attach volume.
    3. For Instance, choose the RDS Custom for SQL Server underlying EC2 host instance.
    4. For Device name, specify your device.
    5. Choose Attach volume.

    Connect to underlying EC2 Instance of RDS Custom for SQL Server instance

    To connect to the RDS Custom for SQL Server EC2 host instance, refer to Connecting to your RDS Custom DB instance using RDP.

    Copy database files to RDS Custom for SQL Server

    After you’re connected to the RDS Custom for SQL Server EC2 host instance, you can copy the files from the newly restored and attached EBS volume to the existing D drive. Ensure you do not copy any system database files from the EBS volume. Complete the following steps:

    1. When you’re connected, navigate to the Folder
    2. Navigate to the drive of the newly attached EBS volume.
    3. Copy the data (.mdf) and log (.ldf) files of user databases that you plan to migrate.
    4. Navigate to the path D:rdsdbdataDATA, and paste these files.

    Attach the databases

    Now you can connect to SQL Server and attach the new databases to fully migrate them from SQL Server running on an EC2 instance to an RDS Custom for SQL Server DB instance. Complete the following steps:

    1. Connect to SQL Server Management Studio. You can use the same primary user credentials that were created upon deployment of your RDS Custom for SQL Server DB instance.
    2. Right-click Databases, then choose Attach.
    3. Choose Add, and then choose the database files and database log files from the D drive that you want to attach.
    4. After the databases are added, choose OK.

    Now you have successfully migrated your databases from SQL Server running on EC2 to RDS Custom for SQL Server.

    Detach EBS volume

    After the successful migration, detach the EBS volume.

    To detach the volume, complete the following steps:

    1. On the Amazon EC2 console, in the navigation pane, choose Volumes.
    2. Select the restored EBS volume that is attached to the underlying EC2 host instance, and on the Actions menu, choose Detach volume.
    3. Choose Confirm detach.

    Unpause automation

    Once you have successfully migrated, unpause the RDS Custom automation.

    Additional Considerations

    During the EBS volume restore, you might experience performance degradation due to lazy loading. Lazy loading means the volume is immediately available but data blocks are loaded from Amazon S3 only when they are first accessed, which can cause initial I/O operations to have higher latency. To mitigate this impact on critical databases, you can perform full table scans (like SELECT *) on important tables immediately after the migration to pre-load the data into memory and ensure optimal performance.

    Additionally, we have demonstrated a solution to only migrate user databases, which doesn’t cover peripheral SQL Server objects such as SQL Server Agent jobs, linked servers, and so on.

    Clean up

    To avoid incurring future charges, delete the resources you created as part of this post:

    1. To delete the newly restored EBS Volume, refer to Delete an Amazon EBS Volume.
    2. To delete the EBS Snapshot, refer to Delete an Amazon EBS Snapshot.

    Conclusion

    This post demonstrates how to migrate SQL Server user databases from EC2 to RDS Custom for SQL Server using EBS snapshots and SQL Server’s attach functionality. This approach offers a faster, more cost-effective alternative to traditional migration methods, especially for large databases. You can adapt this solution to meet your specific business needs and migration requirements. Leave your feedback in the comments section.


    About the Authors

    Nirupam Datta is a Senior Cloud Support DBE at AWS. He has been with AWS for over 5 years. With over 12 years of experience in database engineering and infra-architecture, Nirupam is also a subject matter expert in the Amazon RDS core systems, Amazon RDS for SQL Server, and Amazon Aurora MySQL. He provides technical assistance to customers, guiding them to migrate, optimize, and navigate their journey in the AWS Cloud.

    Dipin Sahadevan is a Cloud Support Engineer working with AWS for over 3 years. Dipin is also a subject matter expert in Amazon RDS for SQL Server. He has 15 years of experience working with relational databases. At AWS he works with external customers to handle a variety of scenarios, such as troubleshooting RDS infrastructure and authoring and improving internal documentation.

    Cade Kettner is a Cloud Support Engineer who has worked with the AWS Database Team for nearly 2 years. In his role, he provides technical assistance with AWS Services including RDS MySQL, RDS MariaDB, RDS SQL Server, Aurora MySQL, and AWS DMS to help troubleshoot technical issues and provide tailored solutions for customers.

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleBest AI-Powered Tools to Build Your Next Project Faster
    Next Article Choose the right throughput strategy for Amazon DynamoDB applications

    Related Posts

    Development

    Laravel Live Denmark

    July 22, 2025
    Development

    The July 2025 Laravel Worldwide Meetup is Today

    July 22, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    The Steam store just got a big update with great new features — here’s what was added

    News & Updates

    AWS costs estimation using Amazon Q CLI and AWS Cost Analysis MCP

    Machine Learning

    The new Surface Pro 12-inch is now the price it should’ve always been — but only because of this limited anti-Prime Day deal

    News & Updates

    CVE-2025-48496 – Emerson ValveLink Path Traversal Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    CVE-2025-3897 – “WordPress EUCookieLaw Plugin Arbitrary File Read Vulnerability”

    May 9, 2025

    CVE ID : CVE-2025-3897

    Published : May 9, 2025, 12:15 p.m. | 3 hours, 23 minutes ago

    Description : The EUCookieLaw plugin for WordPress is vulnerable to Arbitrary File Read in all versions up to, and including, 2.7.2 via the ‘file_get_contents’ function. This makes it possible for unauthenticated attackers to read the contents of arbitrary files on the server, which can contain sensitive information. The vulnerability can only be exploited if a caching plugin such as W3 Total Cache is installed and activated.

    Severity: 5.9 | MEDIUM

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    CVE-2025-48883 – Chrome CSS Selector XSS

    May 30, 2025

    CVE-2025-47657 – Productive Minds Productive Commerce SQL Injection

    May 7, 2025

    CVE-2025-5594 – FreeFloat FTP Server SET Command Handler Buffer Overflow Vulnerability

    June 4, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.