Skip to main content

transfer files using rsync (Answered)

Comments

15 comments

  • cPRex Jurassic Moderator

    Hey there!  Inside the Transfer Tool in WHM, after you have made the initial connection to the Source server so you can see the accounts (https://docs.cpanel.net/whm/transfers/transfer-tool/#the-account-list-interface) you can choose to *not* transfer the Home Directory of the domains.  This will move everything necessary to get the account to function on the new system, such as databases, email user accounts and passwords, but will not transfer the actual website and emails in /home/username.

    Would that be a good option for your situation?

    0
  • Icaro Nadson

    Thanks for the answer,

    Yes, I thought of something like transferring the email accounts configuration and then sending the files from the /home directory to the new server and applying the permissions. So, using the WHM transfer tool, can I do this?

    0
  • quietFinn

    If you have the email accounts in the new server (but without the emails), you can use imapsync to copy the emails.
    https://imapsync.lamiral.info/

     

    0
  • Icaro Nadson

    No, the server is virgin, I'm changing providers, we are currently hosted on a dedicated server from one company and are moving to another company.

     

    I want to use rsync , I know the tool.

    0
  • cPRex Jurassic Moderator

    Yes, you could migrate just the user account and then use rsync to move data between /home/username on both machines.

    You could also do this with "/script/pkgacct username --skiphomedir" to do the same thing on the command line.  You would then move the smaller package that creates over to the new machine, restore the account, and then sync the home directory.

    0
  • Icaro Nadson

    Thank you very much, that's what I needed, so the command /script/pkgacct username --skiphomedir , copies all the files I need to restore the cpanel account, emails, DNS configuration, filters and forwarding. correct? Do you have a model of the rsync command to copy from one server to another?

    0
  • cPRex Jurassic Moderator

    Yes - pkgacct creates a local package of everything needed to recreate the cPanel account and settings *except* for the content in the home directory.

    I'm hesitant to post rsync commands here as I'd hate to have you accidentally overwrite anything, but any normal rsync between systems to move that file over will work.  pkgacct just creates a normal, single file.

    0
  • Icaro Nadson

    Thank you very much, it cleared my mind.

    Sorted out.

    0
  • wasi hales

    Hello everyone, I'm new here, sorry if I'm posting in the wrong place. 

    I have questions about backup and restore. my dedicated server has approximately 1.2TB of email files. I need to transfer to another server and someone suggested me for best botox dubai. However, I no longer have enough space to make the full compressed backup. I would like to know if there is a way to transfer the files using rsync from the old server to the new one without compressing the files? and how to restore the files on the new server?

    the common process by whm, search for the compressed file to restore and it will automatically add the account with all the files. and in this case sending the files, how do I restore the backup?


    I think, your query is already answered but I resolved my issue with the following, i hope it will be beneficial for you as well. You can use rsync to transfer files between servers without compressing them. Here’s a brief guide:

    1. Transfer Files Using rsync:

      rsync -avz --progress user@oldserver:/path/to/email/files/ /path/to/destination/

      Replace user@oldserver:/path/to/email/files/ with the source path and /path/to/destination/ with the destination path on the new server.

    2. Restore Files:

      • For email files: Simply place them in the appropriate email directory on the new server.
      • For account restoration: If using cPanel/WHM, manually create an account and upload the files to the corresponding directory (e.g., /home/username/mail/).

    Ensure that file permissions and ownership are correctly set after transferring.

    0
  • Icaro Nadson

    thank you very much

    That's what I needed, I'm waiting for the server to be ready to continue the service.

    About permissions, which one uses this case?

    I'm grateful for everyone's response, as soon as it's finished I'll post it here

    0
  • cPRex Jurassic Moderator

    If the files are transferred properly with rsync, you shouldn't need to worry about permissions.  In general, all files are 644 and directories are 755.

    0
  • Icaro Nadson

    OK, RSYNC preserves file permissions.

    0
  • cPRex Jurassic Moderator

    Yes, whenever you use the "-a" flag with rsync, those are preserved.

    0
  • Icaro Nadson

    I want to thank everyone for their help, everything went well, this wouldn't have been possible if it weren't for you.

    0
  • cPRex Jurassic Moderator

    You're very welcome, and I'm glad to hear things went well!

    0

Please sign in to leave a comment.