{"id":25950,"date":"2025-09-15T09:00:53","date_gmt":"2025-09-15T01:00:53","guid":{"rendered":"https:\/\/beyond-shenzhen.cn\/?post_type=blog&#038;p=25950"},"modified":"2026-04-20T18:31:40","modified_gmt":"2026-04-20T10:31:40","slug":"website-data-migration","status":"publish","type":"blog","link":"https:\/\/beyond-shenzhen.cn\/en\/blog\/website-data-migration\/","title":{"rendered":"\u3010Data Migration\u3011Migrating a Website to a New Server Environment"},"content":{"rendered":"<p>We recently received the following consultation from a client.<\/p>\n<blockquote><p>We received an emergency notice from our current IDC (Internet Data Center) regarding the termination of their services due to aging server infrastructure and business restructuring.<\/p>\n<p>As a result, we need to migrate all data from our current server environment to a new one within a tight two-week window, and we are requesting your support for this transition.<\/p><\/blockquote>\n<p>This essentially meant it was a critical situation: &#8220;Once the migration deadline passes, the existing server environment will be forcibly shut down and deleted, rendering the website and all associated resources completely inaccessible.&#8221;<\/p>\n<p>&nbsp;<\/p>\n<h2>\u2460 Analysis of Old Server Environment and Active Services, Migration Preparation<\/h2>\n<p>In response to this emergency, our company developed the following plan and proceeded with the server migration work.<\/p>\n<p>Typically, before a server migration, we identify the following information via the web console provided by the IDC:<\/p>\n<ul style=\"list-style-type: disc;\">\n<li>Server Configuration (Server region, OS version, IP address, DNS, CPU, memory, disk, network bandwidth, etc.)<\/li>\n<li>Resource Availability (Databases, SSL, CDN, domains, etc.)<\/li>\n<\/ul>\n<p>However, the old server environment in this case was unique, and the web console was inaccessible. Therefore, we conducted thorough hearings with the client (and their development engineers).<\/p>\n<p>As a result, we determined that the system is a PHP-based UGC (User-Generated Content) site for a specific industry, featuring WeChat Official Account integration and online payment functions.<\/p>\n<p>&nbsp;<\/p>\n<h3>Investigation Results of the Old Server Environment<\/h3>\n<p>Through further detailed investigation, we gained an understanding of the approximate configuration of the website and server environment.<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 386px;\">\n<tbody>\n<tr style=\"height: 26px;\">\n<td style=\"width: 33.3333%; height: 26px; background-color: #138995;\"><span style=\"color: #ffffff;\">Category<\/span><\/td>\n<td style=\"width: 33.3333%; height: 26px; background-color: #138995;\"><span style=\"color: #ffffff;\">Item<\/span><\/td>\n<td style=\"width: 33.3333%; height: 26px; background-color: #138995;\"><span style=\"color: #ffffff;\">Configuration Details<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 144px; background-color: #f3f3f3;\" rowspan=\"6\">Server Environment<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">OS<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">CentOS 7.9.2009<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">CPU<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">4core<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Memory<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">8GB<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">System Disk<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">40GB<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Data Disk<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">200GB<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Network Bandwidth<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">10Mbps\uff08Single line\uff09<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 216px; background-color: #f3f3f3;\" rowspan=\"9\">Software Environment<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">Web Server<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">Nginx 1.24<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Database<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">MySQL 5.7.44<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Programming Language<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">PHP 7.4<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Cache<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">Redis 6.2<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">File Transfer<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">FTP\uff08vsftpd\uff09<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Management Tool<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">phpMyAdmin 5.1<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">WAF<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">ModSecurity<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">SSL Certificate<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">Available<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">Control Panel<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">Pagoda Panel\uff08\u5b9d\u5854\u9762\u677f\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2>\u2461 Log Into the Old Server Environment via SSH Tool (Xshell)<\/h2>\n<p>Our engineers attempted to log into the old server via SSH using Xshell, but the connection could not be established. Furthermore, the server was inaccessible even via local CMD commands (TCP\/IP).<\/p>\n<p>Upon investigation, it was discovered that the network provider used by the IDC server room had withdrawn, leaving only the China Mobile network active.<\/p>\n<p>Ultimately, we prepared a temporary &#8220;Relay Server (Linux Jump Box)&#8221; utilizing the China Mobile network. By first connecting to this relay server via Xshell and then executing the <span style=\"background-color: #f3f3f3;\">ssh root@127.0.0.1<\/span> command, we successfully established a connection to the old server.<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #fff; background: #282c34; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 16px; -webkit-overflow-scrolling: touch;\"><span style=\"color: #d1edff;\"># <\/span>ssh conntect old linux server\r\nssh root@192.168.1.2<span style=\"color: #d1edff;\">\r\n# write old server 192.168.1.2 pwd<\/span><\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2>\u2462 Backup of the Old Server Environment (Programs + Database)<\/h2>\n<p>We connected to the old server via the relay server and compressed\/packaged the server data, program source code, and database.<\/p>\n<p>First, we verified the directory structure and capacity of both the system and data disks to determine the scope and total size of the migration.<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #fff; background: #282c34; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 16px; -webkit-overflow-scrolling: touch;\"><span style=\"color: #d1edff;\"># Display disks<\/span>\r\n[root@MyCloudServer ~]# df\r\n<span style=\"color: #d1edff;\"># List directories<\/span>\r\n[root@MyCloudServer ~]# ls \/path\/to\/directory\r\n<span style=\"color: #d1edff;\"># Check CPU information<\/span> \r\n[root@MyCloudServer ~]# ls lscpu\r\n<span style=\"color: #d1edff;\"># Back up all databases<\/span>\r\n[root@MyCloudServer ~]# mysqldump -u[username] -p --all-databases | gzip &gt; \/path\/to\/backup_file.sql.gz\r\n<span style=\"color: #d1edff;\"># Back up a single database<\/span>\r\n[root@MyCloudServer ~]# mysqldump -u[username] -p[password] [database_name] &gt; \/path\/to\/backup_file.sql\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2>\u2463 Bulk Data Transfer From the Old Server Environment to the Relay Server<\/h2>\n<p>Another challenge was that the old server lacked a dedicated administrator responsible for regular backups and monitoring.<\/p>\n<p>Furthermore, since the client utilized a low-cost local IDC service rather than a major cloud platform like Alibaba Cloud or AWS, security and operational efficiency had not been a primary consideration.<\/p>\n<p>As a result, the server&#8217;s backup capabilities were insufficient; although the website&#8217;s program volume totaled 160GB, the available backup capacity was only 40GB. To address this, we implemented a batch processing approach, migrating data according to the following priorities:<\/p>\n<ol>\n<li>Package PHP source code and MySQL databases, then transfer them to the verification server.<\/li>\n<li>Batch package large files (such as images) and transfer them.<\/li>\n<li>Migrate website data and server logs together.<\/li>\n<li>Package the entire server configuration\u2014including Nginx, MySQL, and PHP settings\u2014for a complete transfer.<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #fff; background: #282c34; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 16px; -webkit-overflow-scrolling: touch;\"><span style=\"color: #d1edff;\"># Transfer the compressed package<\/span>\r\n[root@MyCloudServer ~]# scp \/local\/path\/backup.tar.gz username@remote_host:\/remote\/path\/\r\n<span style=\"color: #d1edff;\"># Transfer a directory<\/span>\r\n[root@MyCloudServer ~]# scp -r \/local\/directory\/ user@remote_host:\/remote\/path\/\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2>\u2464 Data Integrity Verification and Backup<\/h2>\n<p>Since the IDC provided only a single China Mobile line, we experienced drops in transfer speeds and frequent disconnections during large-scale data downloads.<\/p>\n<p>As a result, we implemented the following measures:<\/p>\n<ul style=\"list-style-type: disc;\">\n<li>Conducted a detailed audit of the website&#8217;s program components and prioritized them by transfer size and importance.<\/li>\n<li>Maintained continuous monitoring of the data transfer status.<\/li>\n<li>Performed multiple backup cycles to cross-reference and verify data consistency.<\/li>\n<\/ul>\n<p>Furthermore, to prevent data loss, we established a temporary test environment on the relay server to verify data integrity. We paid particularly close attention to potential data gaps or character encoding issues during database transfers caused by the unstable connection.<\/p>\n<p>After approximately three days of work, we successfully completed the full migration from the old server to the relay server. We then confirmed the data integrity and normal website functionality within the test environment.<\/p>\n<p>Following this, we designed and built the new production server environment. After performing image data optimization (removing duplicates, compression, and deleting unused assets), we migrated the data to the new environment for final production release.<\/p>\n<p>Through these steps, the client was able to successfully overcome the imminent crisis of their service being shut down.<\/p>\n<p>&nbsp;<\/p>\n<h2>Side Note: Why Do Sudden IDC Service Shutdowns Occur?<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-25514\" src=\"https:\/\/beyond-shenzhen.cn\/wp-content\/uploads\/2025\/09\/website-data-migration_img1.webp\" alt=\"\" width=\"1024\" height=\"547\" srcset=\"https:\/\/beyond-shenzhen.cn\/wp-content\/uploads\/2025\/09\/website-data-migration_img1.webp 1024w, https:\/\/beyond-shenzhen.cn\/wp-content\/uploads\/2025\/09\/website-data-migration_img1-300x160.webp 300w, https:\/\/beyond-shenzhen.cn\/wp-content\/uploads\/2025\/09\/website-data-migration_img1-768x410.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>The IDC originally used by this client was a small-scale, local IDC within China.<\/p>\n<p>In principle, operating an IDC involves massive overhead costs, such as rack leasing, electricity, bandwidth fees, hardware procurement, maintenance, and labor.<\/p>\n<p>However, global cloud platforms\u2014led by giants like Alibaba Cloud\u2014now offer services at such low prices that small-scale IDCs can no longer compete.<\/p>\n<p>As a result, it appears the IDC in this case, having lost its competitive edge, was forced to abruptly terminate its services.<\/p>\n<p>&nbsp;<\/p>\n<h2>Summary<\/h2>\n<p>When contracting or utilizing a new server, we recommend selecting a highly reliable IDC or a global cloud platform.<\/p>\n<p>In particular, for projects requiring online payments or high levels of data security, the following global cloud platforms are most suitable:<\/p>\n<ul style=\"list-style-type: disc;\">\n<li>Alibaba Cloud: Widely used across China and worldwide.<\/li>\n<li>AWS: Possesses an extensive track record in Japan, North America, and Europe.<\/li>\n<\/ul>\n<p>These providers ensure stable access, network redundancy, and data security through their globally distributed IDCs.<\/p>\n<p>For needs such as corporate digitalization, overseas expansion, and cross-border trade, cloud platforms with global capabilities offer a significant advantage.<\/p>\n<p>&nbsp;<\/p>\n<h3>Related Services<\/h3>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 50%; background-color: #138995;\"><span style=\"color: #ffffff;\">Website Development<\/span><\/td>\n<td style=\"width: 50%;\"><a href=\"https:\/\/beyond-shenzhen.cn\/en\/service\/website\" target=\"_blank\" rel=\"noopener\">https:\/\/beyond-shenzhen.cn\/en\/service\/website<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%; background-color: #138995;\"><span style=\"color: #ffffff;\">Managed Cloud Services<\/span><\/td>\n<td style=\"width: 50%;\"><a href=\"https:\/\/beyond-shenzhen.cn\/en\/service\/server\" target=\"_blank\" rel=\"noopener\">https:\/\/beyond-shenzhen.cn\/en\/service\/server<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><a class=\"border-circle-inline\" href=\"https:\/\/beyond-shenzhen.cn\/en\/contact\" target=\"_blank\" rel=\"noopener\">For Website Development and Managed Cloud Services<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We recently received the following consultation from a client. We received an emergency notice from our current IDC (Internet Data Center) regarding the termination of their services due to aging server infrastructure and business restructuring. As a result, we need to migrate all data from our current server environment to a new one within a [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":25427,"template":"","meta":{"_acf_changed":false,"_locale":"en_US","_original_post":"https:\/\/beyond-shenzhen.cn\/?post_type=blog&p=20936"},"tags":[],"blogcat":[12],"class_list":["post-25950","blog","type-blog","status-publish","has-post-thumbnail","hentry","blogcat-it-web","en-US"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/beyond-shenzhen.cn\/wp-json\/wp\/v2\/blog\/25950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beyond-shenzhen.cn\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/beyond-shenzhen.cn\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/beyond-shenzhen.cn\/wp-json\/wp\/v2\/users\/5"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/beyond-shenzhen.cn\/wp-json\/wp\/v2\/media\/25427"}],"wp:attachment":[{"href":"https:\/\/beyond-shenzhen.cn\/wp-json\/wp\/v2\/media?parent=25950"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beyond-shenzhen.cn\/wp-json\/wp\/v2\/tags?post=25950"},{"taxonomy":"blogcat","embeddable":true,"href":"https:\/\/beyond-shenzhen.cn\/wp-json\/wp\/v2\/blogcat?post=25950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}