Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ Relational Database Service/ Best Practices/ RDS for SQL Server/ Migrating Data from a Self-Managed SQL Server Database on an ECS to an RDS for SQL Server DB Instance

Migrating Data from a Self-Managed SQL Server Database on an ECS to an RDS for SQL Server DB Instance

Updated on 2024-09-06 GMT+08:00

Scenarios

  • You have created a Microsoft SQL Server database on an ECS.
  • The self-managed SQL Server database version on the ECS cannot be later than the version of the RDS for SQL Server DB instance.
  • You have installed the SQL Server Management Studio (SSMS).

Procedure

  1. Create an ECS.

    NOTE:

    The ECS and the RDS DB instance must be in the same region and VPC.

  2. Install Microsoft SQL Server 2008, 2012, or 2014 on the ECS.

    NOTE:

    The Microsoft SQL Server installed on the ECS must be Standard or Enterprise Edition. It is recommended that the Microsoft SQL Server version be the same as the RDS DB instance version.

  3. Upload a local .bak file to the ECS and use Microsoft SQL Server to restore the local file to the RDS DB instance.
  4. Use the script generation tool provided by Microsoft SQL Server to generate a database structure script.

    1. Right-click the database whose schema script needs to be generated and choose Tasks > Generate Scripts.
    2. On the Choose Objects page, choose database objects to script, as shown in Figure 1. Then, click Next.
      Figure 1 Choosing objects
    3. On the Set Scripting Options page, specify a directory for saving the script.
      NOTE:

      You are advised to save the script locally and generate an SQL script for execution.

      Figure 2 Specifying a directory for saving the script
    4. Click Advanced. In the displayed Advanced Scripting Options dialog box, specify scripting options for triggers, indexes, unique keys, the primary key, and server version. Then, click OK.
      Figure 3 Specifying advanced scripting options
      NOTE:

      Generate Script for Dependent Objects indicates the script data type option.

    5. Click Next to generate the script.

  5. Use the SSMS client to connect to the RDS DB instance and open the generated SQL script.

    NOTE:

    You need to create an empty database, and then use the script to create structures in the database.

  6. Use the import and export function provided by Microsoft SQL Server to migrate data.

    1. Right-click the database where data is to be imported and choose Tasks > Import Data.
    2. Click Next.
    3. On the Choose a Data Source page, select a data source and click Next.
    4. On the Choose a Destination page, select a destination database and click Next.
      • Destination: Select SQL Server Native Client (depending on your destination database type).
      • Server name: Enter the IP address and port number of the destination DB instance.
      • Authentication: Select Use SQL Server Authentication. Then, set User name to rdsuser, and Password to the password of rdsuser.
      • Database: Select the destination database where data is to be imported.
    5. Select Copy data from one or more tables or views and click Next.
    6. On the Select Source Tables and Views page, select the tables and views that you want to copy. Then, click Edit Mappings. In the displayed dialog box, select Enable identity insert and edit mappings based on your requirements.
    7. Click Next.
    8. Select Run immediately and click Next.
    9. Click Finish to import data. You can view the progress. About 4,000 rows can be processed per second.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback