Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to easily migrate a cloud database using DTS

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use DTS to easily migrate cloud databases. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

Preface

I believe that the biggest headache when many old webmasters migrate their websites from the old server to the cloud server is the backup and restore of the database. Some old local portals may have database files even after compression will be as big as a few G, it is impossible to export completely with phpMyAdmin, even if you use other tools to export backup files to upload, download and transfer, you do not know how much time will be wasted, you should know that domestic servers basically do not have much bandwidth.

Here to MySQL server as an example to introduce the operation tutorial, in fact, it also supports SQLServer, PostgreSQL, MongoDB, Redis and other common databases.

Demand & harvest

Products that need to be used:

Any server / ECS/ lightweight application server (install any Linux distribution image)

MySQL database

MySQL version of cloud database (or other databases that accept migration)

Data transmission product

Through this article, you will learn:

Use DTS

Rapid Migration and recovery of Database

Tutorials are migrated database accessible settings

Generally speaking, for the sake of security, the database is only accessed by local (localhost) by default in the traditional website architecture, and the migration of DTS must rely on the public network, so we need to open connection support for DTS.

Server firewall

Generally speaking, the server has a firewall, CentOS 7 is FireWall, CentOS 6 is iptables, Debian is iptables, and Ubuntu Server is UFW.

FireWall Open Database Port:

Systemctl start firewalld.service # enable firewall # Open http 80 and https 443 and SSH 22 ports firewall-cmd-- zone=public-- add-port=3306/tcp-- permanent# effective rule firewall-cmd-- reload

Iptables Open Database Port:

Modify / etc/sysconfig/iptables file

Add in the appropriate location:

-An INPUT-m state-state NEW-m tcp-p tcp-dport 3306-j ACCEPT

Then restart iptables

/ etc/init.d/iptables restart

Ufw Open Database Port

Remote connection of ufw allow mysql open account

First, we need to log in to the database through the command line:

Mysql-u root-p

Then you will need to enter the root password, which is hidden when you enter it, but it doesn't mean you didn't enter it.

Then run:

GRANT ALL PRIVILEGES ON *. * TO 'database account' @'% 'IDENTIFIED BY' corresponding account password 'WITH GRANT OPTION;FLUSH PRIVILEGES

It would be even easier to install phpMyAdmin:

Just change Host to any host in the user-login information

Cdn.com/03dcacd3d0026a5bc43ab99ee0f2a3d7c1a102d6.png ">

Settings of the database

Modify the my.cnf file, which is generally located in: / etc/my.cnf / etc/mysql/my.cnf / usr/local/mysql/etc/my.cnf. If you don't know, refer to the manual of the server environment.

Find bind-address = 127.0.0.1 and modify it to:

Bind-address = 0.0.0.0

Some old MySQL versions may use the skip-networking command to shut down the network and delete it.

Then restart MySQL.

Service mysql restart

Ok, the setup of the migrated database ends here. This is a big difficulty, because different environments are so different.

Transfer

Setting up the migrated database is the only difficulty, but once you have mastered it, you can take all the databases. If the target migration database is a cloud database, no additional settings are required, just create the migration database and account. If you are migrating to a self-built database, you need to repeat the first step again.

First, enter the DTS to create the migration task and fill in the migrated database and the target database, and then click Test to prompt you to pass the test and ok.

Second, choose to migrate objects, generally speaking, the entire database is migrated. If there are special needs, for example, the database of a forum must be growing, if you want to migrate, you may need to close the station, but you can achieve a smooth migration of unclosed stations by incrementally migrating the corresponding tables of posts. Of course, this requires high skills for operators, but it has been greatly reduced the difficulty.

Third, then there is a pre-check. If it is all green, there is nothing at all. If there is something wrong, it needs to be corrected.

4. Then select the link specification:

The prices of different specifications are different, but I don't know whether it is free to migrate to Aliyun or because the amount of demo data is too small.

5. When the two green bars are both 100%, we can modify the database configuration file to change the database to RDS or other migrated databases.

The above is how to easily migrate cloud databases using DTS. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report