The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Migrate accounts without home directory.

Discussion in 'General Discussion' started by vajjra, Feb 26, 2009.

  1. vajjra

    vajjra Member

    Joined:
    Feb 27, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    How do I migrate accounts from my old server to the new server without copying home directories?.

    I saw the "Allow Override" option in WHM but I don't know which script to edit . Can someone help?.

    Thanks,
    Vajjra
     
  2. Zishan

    Zishan Well-Known Member

    Joined:
    Aug 6, 2005
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    0
    As far as I know there is no such option to skip home directory while generating cPanel backup. You will need to backup the home directory on destination server and restore it after restoring the account backup.
     
  3. Zishan

    Zishan Well-Known Member

    Joined:
    Aug 6, 2005
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    0
    In case of large size accounts, I would suggest that you take home directory i.e public_html out of the account and then generate the cPanel backup. Once the backup will be generated, you can move the public_html back and rsycn it to destination server where you have the backup restored.

    P.S This activity requires root SSH access.
     
  4. vajjra

    vajjra Member

    Joined:
    Feb 27, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    My home directories are big in size (more than 2GB). I am getting "xferstream tag failed" message when I start copying accounts. Thats why I thought of "rsync"ing home directory after transferring accounts.
     
  5. vajjra

    vajjra Member

    Joined:
    Feb 27, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Zishan, you're wrong. You can skip the homedir while pkgaccting, using the --skiphomedir option. I wanted to migrate all accounts from one server to another using this option so that it won't copy home dirs. I knew that this can be done using AllowOverride option in WHM Multiple accounts transfer section. However, in order to do this, we need to copy the actual pkgacct (as per cPanel docs, it's located at /usr/local/cpanel/Whostmgr/Pkgacct/pkgacct, but I couldn't find such file on my server) to /var/cpanel/lib/Whostmgr/Pkgacct/pkgacct.

    However, I've found a way by copying the pkgacct file from the /script folder and modified it to skip homedir. The transfer is working fine now as I wanted it to work, using the AllowOverride option.
     
  6. addy

    addy Member

    Joined:
    Apr 13, 2006
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    vajjra,

    If you want to skip homedir while generating cPanel backup then you can use --skiphomedir option.

    Code:
      /scripts/pkgacct --skiphomedir USER 
    After creating the backups, move them to new server and restore. Once the accounts are restored on new server you can rsync the homedir from old server. Also note that "homedir" means /home/USER folder. You need to rsync this entire folder if backups were generated with --skiphomedir option.
     
  7. Zishan

    Zishan Well-Known Member

    Joined:
    Aug 6, 2005
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    0
    Cool, I was not aware of that option. Thanks for letting me know too :)
     
  8. vajjra

    vajjra Member

    Joined:
    Feb 27, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Does anyone know how can we disable home dir sync while transferring accounts via WHM?.
     
  9. cPanelStephen

    cPanelStephen Active Member
    Staff Member

    Joined:
    Aug 7, 2007
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    This is not possible at the moment. I have opened an enhancement request and spoken with our developers concerning this, and they are currently reviewing options for implementing this feature in forthcoming builds.

    In the meantime, you will need to manually package and transfer any accounts that you wish to skip the home directory for.
     
  10. vajjra

    vajjra Member

    Joined:
    Feb 27, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello Stephen,

    As it was necessary to skip homedir sync, I looked for a workaround and found a way out. I've modified the file Transfers.pm to skip homedir sync and it's working successfully now. Thank you:)
     
  11. cyon

    cyon Well-Known Member
    PartnerNOC

    Joined:
    Jan 15, 2003
    Messages:
    320
    Likes Received:
    0
    Trophy Points:
    16
    Hi vajjra,

    would you mind sharing your workaround?

    All the best
     
  12. vajjra

    vajjra Member

    Joined:
    Feb 27, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I have modified the file /usr/local/cpanel/Whostmgr/Transfers.pm as below:

    Goto line: 953

    Code:
        mkdir( $user_homedir, 0711 );
        dot_run_sub(
            sub {
                if ( exists $OPTS{'stream'} ) {
                    my $streamok = 0;
                        if ( !$streamok ) {
                            print "Please transfer homedir manually...\n";
                        }
                    }
                   else {
    
     
Loading...

Share This Page