Solved CPanel to DA conversion script question, no cp-move files but other maybe similar files?

Richard G

Verified User
Joined
Jul 6, 2008
Messages
14,306
Location
Maastricht
Some customer had to get out on a hoster with cPanel. My collegue admin has gotten backup files, which are not cpmove.user.tar.gz files.
That customers does not have any access anymore to his cPanel account.

The files are called like backup-6.10.2023_22-33-34_domain.tar.gz without the domain extension.
As far as I know all domains had their own account in cPanel.

When looking in the tar.gz files it looks like everything is present, but to use the CP->DA conversion script I need cpmove.user.tar.gz files according to the docs.

Since these domains where all seperate accounts, can I just rename those to for cpmove.user.tar.gz and then use the CP to DA conversion script?
Or are these really different backups and can't be used with the conversion script.

Does anybody have experience with these kind of cPanel backup files importing them to DA?
 
@smtalk I get an error on the restore.

Code:
Unable to find cPanel user configuration in /home/admin/converted_user_backup/foobar_cpanel_to_convert/cp/foobar

Seems something is missing here.
Also extracted files are not removed after the error.

Could this be because I changed the username too? It has a long name like "thisistheusername" and I changed it to "thisuser".
I the /cp/ directory, there is a file which does have the long username. So I require to user the long username?
 
LoL and now I put the username original and now I get:
thisistheusername is not a valid username.

When looking in the file on the server, there is an empty logfile and this file:
user.otheruser.thisistheusername.tar.zst

So I presume that "thisistheusername" is a reseller and I have to find the correct "thisistheusername" reseller to restore first, right?
 
Seems we got a reseller issue but I don't know how to solve.

For example, user 1 is named john01 and user 2 is named tim03.
But when using the restore I only get errors saying "john01 is not a valid username" and "time03 is not a valid username" for all existing backups.

However in the filebase I see files like this when this error occurs:
user.frank1s.john01.tar.zst

Where is this frank1s coming from? Was this the previous reseller? And how do I prevent this from happening and just install the users?

Furthermore, the backups got a user configuration files with a name of 16 characters and even with longest setting, DA has 14. I want to keep DA to 10. Will it be just shortened to 10 characters?
 
Now I created the reseller frank1s, and try again restoring via admin backup/transfer on a different user with shorter name.

Still an error, now a different one, seems the CP to DA script has issues.
Unable to extract backup/user.conf from /home/admin/converted_user_backup/user.frank1s.knc.tar.zst
Error while extracting backup/user.conf to /home/admin/converted_user_backup/knc as admin : /bin/tar: This does not look like a tar archive
/bin/tar: Skipping to next header
/bin/tar: backup/user.conf: Not found in archive
/bin/tar: Exiting with failure status due to previous errors


Cannot read /home/admin/converted_user_backup/knc/backup/user.conf : Unable to open /home/admin/converted_user_backup/knc/backup/user.conf for reading.
No such file or directory

Filename: cpmove-knc.tar.gz

I will be waiting now because seems I can't fix it anyway.

Edit: No problems unpacking the stuff via console on the server. Also unzipping results in the tar file zo it's not double gzip packed.
Edit2: Unpacking and re-packing seems to have done the trick for now.
 
Last edited:
Oke I'm fed up now... tried unpacking and repacking the other archives, but problem keeps existing.

Also things like this:
WARNING! Mailman files detected in mma/priv/, these will not be restored:
redacxxx_domain.nl
redacxxx_domain.nl.mbox
WARNING! Mailman files detected in mm/, these will not be restored:
redacxxx_domain.nl

Unable to extract backup/user.conf from /home/admin/converted_user_backup/user.ratoin1q.user.tar.zst
Error while extracting backup/user.conf to /home/admin/converted_user_backup/user as admin : /bin/tar: This does not look like a tar archive
/bin/tar: Skipping to next header
/bin/tar: Archive contains `v\274\277\030 \355bf\212\002\257\217' where numeric off_t value expected
/bin/tar: Archive contains `\262G\017)\314\030\340P' where numeric mode_t value expected
/bin/tar: Archive contains `\343xHѬ6\370\226\320.\367\221' where numeric time_t value expected
/bin/tar: Archive contains `{\367\260\246\326\364v\321' where numeric uid_t value expected
/bin/tar: Archive contains `TK;\335\323=1\020' where numeric gid_t value expected
/bin/tar: Skipping to next header
/bin/tar: backup/user.conf: Not found in archive
/bin/tar: Exiting with failure status due to previous errors

and also archive errors again as mentioned in previous post.
 
Oke fixed it, but there is a bug in the conversion script.
DA must be set to use zstd for the restore work.

I put in a ticket for this bug.
Ticket #50686
 
For anyone interested or maybe legacy licenses doing cpanel imports in the future and have zstd disabled and/or use the DA default username length.

At this moment when using CPMOVE there the conversion script is not checking the directadmin.conf setting if tar.gz should be used for backups or not and it will create a .zst file during conversion.

So people converting either multiple or single CPanel accounts to DA via conversion with cpmove files and then importing via admin backup/transfer should mind the following.

1.) When getting a "file not found" error on the restore with a .zst file, check that zstd is build and in directadmin there is no zstd=0 setting present. No setting or zstd=1 is good. On new installations this is the default.

2.) When getting a "accountname does not exist" error:
a). Check via SSH in the filebase if you see double names like a user.accountname.otheraccountname.zst file. This means that it's a reseller backup. In that case you have to create a dummy reseller account with the first accountname.
b.) if the second accountname is a long name, set directadmin to use 16 character usernames:
Code:
/usr/local/directadmin/directadmin set max_username_length 16
service directadmin restart

This will however make the option for database names very short. So personally I would suggest restoring the long cpanel username accounts then change the account name to a shorter one (10 characters or less) afterwards, using this script:
Code:
cd /usr/local/directadmin/scripts
./change_username.sh oldusername newusername
and then change the username setting of DA back to 10 characters (and don't forget to restart DA).

This is -as is- at the moment. According to DA they have tasks to refactor the backup related stuff in directadmin. So this might get changed in the future.

New installs should have no issues with this at all, since the default is already backup_gzip=2 and zstd=1. So on fresh install's the setting will be correct anyway, except for the username length in case long CP usernames were used.
 
Last edited:
Back
Top