Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Fastest way to migrate cPanel to cPanel
- Whats the fastest way to migrate 1 cpanel account with more than 200GB in size?
- ++++++++++++++
- list of top cheapest host http://Listfreetop.pw
- Top 200 best traffic exchange sites http://Listfreetop.pw
- free link exchange sites list http://Listfreetop.pw
- list of top ptc sites
- list of top ptp sites
- Listfreetop.pw
- Listfreetop.pw
- +++++++++++++++
- Both has root access..
- Since you have root access on both servers,
- 1) You will have to generate your account backup with --skiphomedir , With this options cPanel backup scripts will create your cPanel account backup without user home directory.
- 2) Migrate account backup file to new server using rsync and restore that file on your new server.
- 3) Once backup file is restored, Just rsync your user home directory from old server to new server with rsync.
- 4) Take a database's dump from source server and then restore them in new server.
- TuxAndrew
- Linux - RedHat|cPANEL CentOS,Ubuntu |Azure-Vm/AWS-Ec2 Administrator,
- Assistance, Analysis and Diagnosis| Skype: tuxandrew
- Since you have root access on both servers,
- 1) You will have to generate your account backup with --skiphomedir , With this options cPanel backup scripts will create your cPanel account backup without user home directory.
- 2) Migrate account backup file to new server using rsync and restore that file on your new server.
- 3) Once backup file is restored, Just rsync your user home directory from old server to new server with rsync.
- 4) Take a database's dump from source server and then restore them in new server.
- step 4 only would make sense if step 1 included --skipacctdb https://documentation.cpanel.net/dis...pkgacct+Script. Otherwise, step 1 would already include the account's database backups
- mega-uploading.com
- rootlayer.net
- worldwidete.com
- faucetgame.com
- load-tang.blogspot.com
- domain model
- sedigo.com
- Exclude the account's databases from the cpmove archive.
- --skiphomedir
- Exclude the account's home directory from the archive.
- As to speed of backup/transfer it would depend on where that 200GB of data lies.
- If it's a large MySQL databases, then above --skiphomedir only won't help as without --skipacctdb flag, step 1 will be backing up your large MySQL databases and it will be restored when you restore the cpanel pkgacct backup file so doing step 4 as well just doubles the time taken as you do database backup/restores twice - once in step 1 and a 2nd time in step 4. Adding --skipacctdb to step 1, will mean you can then do faster MySQL database backups/restores manually (step 4 above) via multi-threaded MySQL database backup tools like mydumper instead of single threaded mysqldump and then restore using multi-threaded mydumper's myloader command tool instead of single threaded native mysql client restores. With mydumper, databases are backed up into sql files on an individual table basis into a directory you tell it to save to. So you can eventually tar compress that directory for transfer too and use faster pigz multi-threaded gzip or facebook's zstd compression for the tar'd directory.
- If it's large data files in /home/username/*, then --skiphomedir MAY help as you can have faster options to backup /home/username/* - rsync is one but would be slow if you have many smaller files as opposed to using tar compressed backups. You can use tar with faster compression algorithms of which cpanel has pigz support for multi-threaded gzip. Or you can install facebook's zstd compression for even faster compression and smaller compressed tar file but it may use more memory by default (you can tune to use less memory). Smaller compressed tar file may help if you're network bandwidth/uplinks between both servers is slower i.e. <500Mbit-1Gbps
- Quick test I shared with my forum users a while back with mydumper 0.95 built against MariaDB 10.3.13 with GCC 8.3.1 compiler and 261MB sized dummy InnoDB MySQL database consisting of 20 tables each with 50000 rows.
- Code:
- mydumper -V
- mydumper 0.9.5, built against MySQL 10.3.13
- On 2 cpu thread KVM VPS with Intel Xeon Silver 4114 @ 2.20Ghz
- mydumper backup speed = 103.57 MB/s 6214.20 MB/min 364.11 GB/hr = 1.9x faster than mysqldump backup.
- myloader restore speed = 14.27 MB/s 856.20 MB/min 50.16 GB/hr = 2.03x faster native mysql restores
- mysqldump backup speed = 54.26 MB/s 3255.60 MB/min 190.75 GB/hr. An optimised mysql config backup speed = 61.26 MB/s 3675.60 MB/min 215.36 GB/hr which is 12.9% faster now.
- mysql native restore speed = 7.03 MB/s 421.80 MB/min 24.71 GB/hr
- if your server hardware and mysql configuration is optimal, it should scale with more cpu threads allocated to mydumper/myloader
- My mydumper vs mysqldump benchmark script I wrote.
- mydumper backup
- Code:
- ./mydumperbench.sh mydumper
- ----------------------------------------------------------------------------------------
- mydumperbench.sh 0.0.9 by George Liu (eva2000)
- https://centminmod.com
- Sun Sep 22 05:15:02 UTC 2019
- ----------------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------------
- [sbtest total size: 261 MB]
- [mydumper threads: 2 ] mydumper -t 2 -B sbtest
- [backup stats:] real: 2.52s user: 1.28s sys: 0.75s cpu: 80% maxmem: 8124 KB cswaits: 2178
- [backup speed:] 103.57 MB/s 6214.20 MB/min 364.11 GB/hr
- Successfully backed database using mydumper using 2 threads
- ----------------------------------------------------------------------------------------
- *************************************************************************************
- Sun Sep 22 05:16:07 UTC 2019
- results logged: /root/mydumperlogs/mydumperbench_220919-051501.txt
- Sep 21 22:24 mydumper_extstats_210919-222320.txt
- Sep 21 22:24 mydumper_mysqlreport_210919-222320.txt
- Sep 21 22:24 mydumperbench_210919-222320.txt
- Sep 21 22:24 mydumperstats_210919-222320.txt
- Sep 21 22:24 mydumpercsv_210919-222320.txt
- Sep 21 22:24 mydumper_mycnf_210919-222320.txt
- Sep 21 22:25 mydumper_extstats_210919-222445.txt
- Sep 21 22:25 mydumper_mysqlreport_210919-222445.txt
- Sep 21 22:25 mydumperbench_210919-222445.txt
- Sep 21 22:25 mydumperstats_210919-222445.txt
- Sep 21 22:25 mydumpercsv_210919-222445.txt
- Sep 21 22:25 mydumper_mycnf_210919-222445.txt
- Sep 22 05:16 mydumper_extstats_220919-051501.txt
- Sep 22 05:16 mydumper_mysqlreport_220919-051501.txt
- Sep 22 05:16 mydumperbench_220919-051501.txt
- Sep 22 05:16 mydumperstats_220919-051501.txt
- Sep 22 05:16 mydumpercsv_220919-051501.txt
- Sep 22 05:16 mydumper_mycnf_220919-051501.txt
- *************************************************************************************
- CSV format:
- threads,real time,user time,system time,cpu %,max mem,context switch waits,speed (MB/s),speed (MB/min),speed (GB/hr)
- 2,2.52,1.28,0.75,80,8124,2178,103.57,6214.20,364.11
- myloader restore
- Code:
- ./mydumperbench.sh myloader
- ----------------------------------------------------------------------------------------
- mydumperbench.sh 0.0.9 by George Liu (eva2000)
- https://centminmod.com
- Sun Sep 22 05:16:16 UTC 2019
- ----------------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------------
- [export-20190922-051604 total size: 190 MB]
- [myloader threads: 2 ] myloader -t 2 -d export-20190922-051604 -B sbtest -q 10000
- [restore stats:] real: 13.31s user: 0.36s sys: 0.24s cpu: 4% maxmem: 7912 KB cswaits: 1241
- [restore speed:] 14.27 MB/s 856.20 MB/min 50.16 GB/hr
- Successfully restored mydumper backup using 2 threads
- ----------------------------------------------------------------------------------------
- *************************************************************************************
- Sun Sep 22 05:17:32 UTC 2019
- results logged: /root/mydumperlogs/myloaderbench_220919-051616.txt
- Sep 22 05:17 myloader_extstats_220919-051616.txt
- Sep 22 05:17 myloader_mysqlreport_220919-051616.txt
- Sep 22 05:17 myloaderbench_220919-051616.txt
- Sep 22 05:17 myloaderstats_220919-051616.txt
- Sep 22 05:17 myloadercsv_220919-051616.txt
- Sep 22 05:17 myloader_mycnf_220919-051616.txt
- *************************************************************************************
- CSV format:
- threads,real time,user time,system time,cpu %,max mem,context switch waits,speed (MB/s),speed (MB/min),speed (GB/hr)
- 2,13.31,0.36,0.24,4,7912,1241,14.27,856.20,50.16
- mysqldump backup
- Code:
- ./mydumperbench.sh mysqldump
- ----------------------------------------------------------------------------------------
- mydumperbench.sh 0.0.9 by George Liu (eva2000)
- https://centminmod.com
- Sun Sep 22 05:19:09 UTC 2019
- ----------------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------------
- [sbtest total size: 261 MB]
- [mysqldump threads: 1 ] mysqldump sbtest > /backup-mydumper/mysqldump/sbtest_220919-051909.sql
- [backup stats:] real: 4.81s user: 3.49s sys: 0.99s cpu: 93% maxmem: 5120 KB cswaits: 434
- [backup speed:] 54.26 MB/s 3255.60 MB/min 190.75 GB/hr
- Successfully backed up database using mysqldump
- ----------------------------------------------------------------------------------------
- *************************************************************************************
- Sun Sep 22 05:20:16 UTC 2019
- results logged: /root/mydumperlogs/mysqldumpbench_220919-051909.txt
- Sep 21 22:21 mysqldump_extstats_210919-222024.txt
- Sep 21 22:21 mysqldump_mysqlreport_210919-222024.txt
- Sep 21 22:21 mysqldumpbench_210919-222024.txt
- Sep 21 22:21 mysqldumpstats_210919-222024.txt
- Sep 21 22:21 mysqldumpcsv_210919-222024.txt
- Sep 21 22:21 mysqldump_mycnf_210919-222024.txt
- Sep 22 05:20 mysqldump_extstats_220919-051909.txt
- Sep 22 05:20 mysqldump_mysqlreport_220919-051909.txt
- Sep 22 05:20 mysqldumpbench_220919-051909.txt
- Sep 22 05:20 mysqldumpstats_220919-051909.txt
- Sep 22 05:20 mysqldumpcsv_220919-051909.txt
- Sep 22 05:20 mysqldump_mycnf_220919-051909.txt
- *************************************************************************************
- CSV format:
- threads,real time,user time,system time,cpu %,max mem,context switch waits,speed (MB/s),speed (MB/min),speed (GB/hr)
- 1,4.81,3.49,0.99,93,5120,434,54.26,3255.60,190.75
- mysql restore
- Code:
- ./mydumperbench.sh mysqlrestore
- ----------------------------------------------------------------------------------------
- mydumperbench.sh 0.0.9 by George Liu (eva2000)
- https://centminmod.com
- Sun Sep 22 05:30:12 UTC 2019
- ----------------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------------
- [/backup-mydumper/mysqldump/sbtest_220919-051909.sql size: 188 MB]
- [mysql threads: 1 ] mysql sbtest < /backup-mydumper/sbtest.sql
- [restore stats:] real: 26.74s user: 3.48s sys: 0.21s cpu: 13% maxmem: 6480 KB cswaits: 1159
- [restore speed:] 7.03 MB/s 421.80 MB/min 24.71 GB/hr
- Successfully restored mysqldump backup
- ----------------------------------------------------------------------------------------
- *************************************************************************************
- Sun Sep 22 05:31:43 UTC 2019
- results logged: /root/mydumperlogs/mysqlrestorebench_220919-053012.txt
- Sep 22 05:22 mysqlrestorebench_220919-052052.txt
- Sep 22 05:22 mysqlrestore_extstats_220919-052052.txt
- Sep 22 05:22 mysqlrestore_mysqlreport_220919-052052.txt
- Sep 22 05:22 mysqlrestorestats_220919-052052.txt
- Sep 22 05:22 mysqlrestorecsv_220919-052052.txt
- Sep 22 05:22 mysqlrestore_mycnf_220919-052052.txt
- Sep 22 05:31 mysqlrestore_extstats_220919-053012.txt
- Sep 22 05:31 mysqlrestore_mysqlreport_220919-053012.txt
- Sep 22 05:31 mysqlrestorebench_220919-053012.txt
- Sep 22 05:31 mysqlrestorestats_220919-053012.txt
- Sep 22 05:31 mysqlrestorecsv_220919-053012.txt
- Sep 22 05:31 mysqlrestore_mycnf_220919-053012.txt
- *************************************************************************************
- CSV format:
- threads,real time,user time,system time,cpu %,max mem,context switch waits,speed (MB/s),speed (MB/min),speed (GB/hr)
- 1,26.74,3.48,0.21,13,6480,1159,7.03,421.80,24.71
- The more cpu threads your servers have, the faster the mysql database backup and restore via mydumper/myloader. So if majority of that 200GB is MySQL data, you'd need to use faster backup method than cpanel's native pkgacct's mysqldump single threaded tool.
- So if majority of that 200GB is MySQL data, you'd need to use faster backup method than cpanel's native pkgacct's mysqldump single threaded tool.
- I would strongly recommend skipping the DB in the cpanel backup entirely - and do not perform a mysqldump locally either.
- Since OP has root on both machines, the best way to transfer the database is to allow New Server to access MySQL over the network (ie, punch a hole in your firewall on OldServer to permit NewServer to connect to it)
- Then on new server, do the mysqldump command there and -h old.server.ip.address and dump it directly over the network.
- Why?
- Because there is almost always a difference in MySQL/MariaDB server versions. A mysqldump on OldServer might not be directly importable into NewServer's database.
- However, the mysqldump program from a newer version will automatically perform any changes needed during the dump from the old DB server. That dump file is then guaranteed to import cleanly on your new server - without any issues what-so-ever.
- tl;dr - unless MySQL/MariaDB are exact same versions on both servers then save yourself a potential headache, and run the mysqldump command on the new server's command line to dump the old server's DB.
- "I've seen spam you people wouldn't believe. Routers on fire off the OCs of AGIS. I watched MXes burning in the dark near the Cyberpromo Gateway. All those moments will be lost in time, like tears in rain. TTL=0."
- Indeed though cpanel to cpanel is more likely to have same MySQL fork version if setup and configured by same person. But mysqldump generally is compatible for MySQL 5.7 and MariaDB 10.3 and below - MySQL 8.0 and MariaDB 10.4 could run into issues. But you can run into issues if going from MariaDB to MySQL due to cpanel user prefix limits.
- Guess the rule of thumb, ensure cpanel on source and destination servers are the same MySQL/MariaDB versions and should be fine to skip database backups via --skipacctdb and then use multi-threaded mydumper for faster database backup/restores if his 200GB data is mainly from MySQL databases. This would be faster than dumping database backups over the network via specifying -h hostname on mysqldump.
- CentminMod.com Nginx Installer (Nginx 1.17, PHP-FPM 5.4-5.6, 7.0-7.3 (7.4 ready), MariaDB 10 + optional ngx_pagespeed/lua) for CentOS
- Whats the fastest way to migrate 1 cpanel account with more than 200GB in size?
- Both has root access..
- Thank you!
- Fastest way without being notice?
- Leave the old server online while doing the migration and change the DNS accordingly.
- Fastest way without being notice?
- No lol..
- I need to migrate the data as fast as possible to minimize the time that the website is closed because its a high traffic and many users are waiting.
- If I leave the website open, there might be new contents posted on the website during the transition that might not be included
- I need to migrate the data as fast as possible to minimize the time that the website is closed because its a high traffic and many users are waiting.
- If I leave the website open, there might be new contents posted on the website during the transition that might not be included
- Short of having a full mysql replicated setup with distributed shared NFS share for files and load balancer like setup, having a maintenance static html page is very useful for these cases and if you're creative it can add value as you could have the static html page with messages and links to site's social media pages to keep visitors informed via social media as well as drive traffic and eye balls to social media accounts as well as the obvious - offload load from php/database requests so it speeds up file/db backup and transfer process.
- You can also do dummy test backup and restore tests to time how long it would take roughly so you have an idea of maintenance duration you convey to visitors.
- Its depend on network speed in between your two servers. A few days ago, I tested 70 GB transfer using cPanel migration tool and it I was sucessful. Probably within 20-30 minutes.
- Personally would only handle such migrations via manual methods and not via cpanel migration. For example:
- Change site to use cloudflare or other proxy services where your origin server can be updated and visitors will hit the new server near instantly.
- Do an rsync of the site from one server to the other and ensure ownership of files and directories are correct on the new server
- Do another rsync on directories that hold content that is updated constantly to catch any that was done during the initial rsync
- Take site down for maintenance
- Dump database, import to new server, change script to use new server for database access and/or remove mysql users to avoid split brains.
- At proxy service, change origin to new server
- Bring site back online at new server only .
- Do another rsync of the content directories to get any content updated during the last few steps.
- You could do the initial rsync via a cpanel migration and then do manual rsyncs afterward. If you go with just rsync for the initial one, do so within a screen or detach the process from the current SSH session to avoid the rsync being interrupted with any connection issues with the SSH session.
- This process should limit maintenance / downtime to when you are switching the database around and the additional rsyncs should complete quickly since the bulk of the content has been moved over. Users should not see missing content and if they do the last rsync should fix that.
- -Steven | u2-web@Cooini, LLC - Business Shared Hosting | Isolate sites with Webspaces | Site Builder | PHP-FPM | MariaDB
- WHMCS Modules: Staff Knowledgebase | Custom Modules and Hooks
- "It is the mark of an educated mind to be able to entertain a thought without accepting it" -Aristotle
- My favorite is the tool built right into cPanel, I've done 50 GB transfers, no problem. Haven't tested any higher capacities yet though.
- Well, the million dollar question is still - where is the bulk of that 200GB at?
- If it's files... rsync is the way to go... using something similar to what @tuxandrew suggested. The nice thing about rsync is... you can synch it as many times as you want. The first synch is going to take a while because it has to copy all the files over. But subsequent synchs - and the more often you run them - will be shorter as the change in files would be less and less. Then skipping the home directory with the cPanel backup package, send that to the new server, move the rsync'd home directory out of the way, restore it, and then move the user's home directory back, do some wide assortment of chown to change all of the files back to their respective owner, update IP, and you're done.
- But if the bulk of that 200GB is in the database... then this gets quite a bit more complex. I suppose you could set up a MySQL master/slave duplication between the two servers. I really don't have a ton of experience with any of this, perhaps others do. You could dump the database and rsync the differences... but if the database is that large... it's probably going to take a while to both dump and then re-insert on the new server.
- But the point is, you really need to know where the bulk of the 200GB is being used at and then formulate a procedure based on that.
- But if the bulk of that 200GB is in the database... then this gets quite a bit more complex. I suppose you could set up a MySQL master/slave duplication between the two servers. I really don't have a ton of experience with any of this, perhaps others do. You could dump the database and rsync the differences... but if the database is that large... it's probably going to take a while to both dump and then re-insert on the new server.
- But the point is, you really need to know where the bulk of the 200GB is being used at and then formulate a procedure based on that.
- Other option if you have know-how and disk space is use MySQL binary logging so you can do snapshot mysql backup and transfer and they replay the binary logs from existing server on the destination server to get up to update MySQL transactions/data sync'd. But static html maintenance page method would be easiest and cheapest to implement.
- Also, as well as telling us whether the bulk of the data is in the DB or the files, I'd suggest you do a trial transfer to see how long it takes and what problems you run into. Document those problems and work out a way around them (probablyt not going to be too difficult), test it, and then repeat it for the real site. You're asking for problems if you try to move the site without testing.
- Don't know if this is an option, but you might consider putting the site into read-only while you do the transfer. That way at least the site is partly available.
- Lots of amazing quality advice above. You might want to hire a sysadmin to do the move - 200Gb is up at the difficult end for anyone.
Add Comment
Please, Sign In to add comment