My VPS crashed so setup a new VPS and moving *.tar.gz cPanel accounts from backup and restoring them through Full Backup restore function of WHM, however running into captioned error for every account transferred.
Can you please tell me what is the solution to this? It seems there some "/" in the restore files thats causing the issue here, but how can change/resolve/bypass that and get the restore to complete?
A quick look at the files reveals that the files have been moved into a temp folder in root however the cpanel account has been created and its mapping the file manager to its respective files - But its not sitting where it should be ... under /home directory. Furthermore the associated domain is not fully functional, while home page links, sub domains dont.
Took the liberty to check the line 668 in ArchieveManager.pm and it corresponds to the following codes string:Failed: Account Restore Failed: “clean: Cannot cleanup top level directory: “/cpanelpkgrestore.TMP.work.3x9vXyS3 ”. at /usr/local/cpanel/Whostmgr/Transfers/ArchiveManager.pm line 668. ”
Code:
sub cleanup {
my ($self) = @_;
if ( $self->{'_temp_extract_dir'} && -e $self->{'_temp_extract_dir'} ) {
# Ensure we never clean /XXXX
# These are various safety checks to avoid blowing away
# any directories that should never be cleaned up
my $target_with_trailing_slash = $self->{'_temp_extract_dir'};
$target_with_trailing_slash =~ s{/+$}{};
if ( ( $target_with_trailing_slash =~ tr{/}{} ) <= 1 ) {
die "clean: Cannot cleanup top level directory: “$self->{'_temp_extract_dir'} ”.";
}
my $run = Cpanel::SafeRun::Object->new(
program => '/bin/rm',
args => [ '--recursive', '--force', '--', $self->{'_temp_extract_dir'} ],
);
warn $run->stderr() . $run->autopsy() if $run->CHILD_ERROR();
A quick look at the files reveals that the files have been moved into a temp folder in root however the cpanel account has been created and its mapping the file manager to its respective files - But its not sitting where it should be ... under /home directory. Furthermore the associated domain is not fully functional, while home page links, sub domains dont.