CLI admin backup not working, license expired.

risto

Verified User
Joined
Nov 9, 2021
Messages
5
Hi all,

Due to a problem with my host the license was not enabled.

Now I need to reinstall the server and followed the full admin backup command from the doc, but it's not working.

/usr/local/directadmin/directadmin admin-backup --destination=/home/admin/admin_backups

instant response:

admin

there it ends, no errors or other info...

Any ideas?
 
hi @risto, which version of DA are you running. Could you give us the output of /usr/local/directadmin/directadmin o?

This is how it looks on our test machine with a couple of accounts:

Code:
# /usr/local/directadmin/directadmin o
Compiled on 'Linux 64-bit'
Compile time: Nov  9 2021 at 13:31:18
Timestamp: '1636464673'
Compiled with IPv6
Static binary: yes
commit sha: a7632e8d7e8d18200955896464b242c5df79f109
OS slug: linux_amd64
package: directadmin_a7632e8d7e8d18200955896464b242c5df79f109_linux_amd64.tar.gz
gettext support: yes
gettext path: /usr/local/directadmin/data/lang

# ls -l /home/admin/admin_backups
total 0

# /usr/local/directadmin/directadmin admin-backup --destination=/home/admin/admin_backups

# ls -l /home/admin/admin_backups
total 556
-rw-r----- 1 admin jadmin     26477 Nov  9 18:15 admin.admin.jadmin.tar.gz
-rw-r----- 1 admin tmpadmin   23871 Nov  9 18:15 admin.admin.tmpadmin.tar.gz
-rw-r----- 1 admin admin      45475 Nov  9 18:15 admin.root.admin.tar.gz
-rw-r----- 1 admin jreseller  43076 Nov  9 18:15 reseller.admin.jreseller.tar.gz
-rw-r----- 1 admin jonas     267042 Nov  9 18:15 user.jadmin.jonas.tar.gz
-rw-r----- 1 admin petras    150760 Nov  9 18:15 user.jadmin.petras.tar.gz
 
[root@vps2 ~]# /usr/local/directadmin/directadmin o
Compiled on 'CentOS 8.0 64-Bit'
Compile time: Oct 21 2021 at 08:13:32
Timestamp: '1634803997'
Compiled with IPv6
Static binary: yes
commit sha: a8ac330b60c49665f1df6d0e8229fa15127e04c9
OS slug: rhel8_amd64
package: directadmin_a8ac330b60c49665f1df6d0e8229fa15127e04c9_rhel8_amd64.tar.gz
gettext support: yes
gettext path: /usr/local/directadmin/data/lang
[root@vps2 ~]# ls -l /home/admin/admin_backups
total 0
[root@vps2 ~]# /usr/local/directadmin/directadmin admin-backup --destination=/home/admin/admin_backups
admin
[root@vps2 ~]# ls -l /home/admin/admin_backups
total 0

The server has been upgraded from CentOS8 to Almalinux, but the log shows CentOS, don't think it will have any influence?
 
The issue is that you are running DA v1.63.0. Backup with CLI arguments were introduced in version DA v1.63.1. To perform full backup on older versions please do:

Code:
echo "action=backup&append%5Fto%5Fpath=nothing&database%5Fdata%5Faware=yes&email%5Fdata%5Faware=yes&local%5Fpath=%2Fhome%2Fadmin%2Fadmin%5Fbackups&owner=admin&type=admin&value=multiple&when=now&where=local&who=all" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d200

Sorry we were too eager to upgrade the docs with the latest instructions. I think it would be best to keep commands for older installation in the docs as well.
 
Would be nice to enable the update to 1.63.1 without a valid license to perform the backup, or maybe a small trial. ;-)

The command is working, but is there a switch to create a gzip which can be restored inside the DA dashboard at the new server?

Thanks for the support!
 
I managed to create tar.zst backup files, final question. Are tar.zst compatible files inside the DA dashboard Restore Backup method?

Thanks again!
 
@risto, you can upgrade DA without valid license using getDA.sh script, example:

Code:
/usr/local/directadmin/scripts/getDA.sh current

Restore should work from the web interface in Dashboard -> Admin Backups -> Restore Backup but files needs to be uploaded into /home/admin/admin_backups (or some other location) on the server where backups will be restored.

 
/usr/local/directadmin/scripts/getDA.sh current

That did the trick! Might be useful inside the documentation, thanks a lot!
 
  • Like
Reactions: fln
@Richard G, using getDA.sh to download latest DA version does not allow one to run DA with expired license. If the license was expired, newer DA version will not run just like the old one.

In this particular case @risto wanted to use backup feature which works without a valid license, so with newer DA binaries it was possible to use new CLI arguments that triggers that backup. For older versions custom dataskq task entry needs to be created, but backuping works without a valid license in older versions as well (by design to allow extracting data from old servers).
 
The issue is that you are running DA v1.63.0. Backup with CLI arguments were introduced in version DA v1.63.1. To perform full backup on older versions please do:

Code:
echo "action=backup&append%5Fto%5Fpath=nothing&database%5Fdata%5Faware=yes&email%5Fdata%5Faware=yes&local%5Fpath=%2Fhome%2Fadmin%2Fadmin%5Fbackups&owner=admin&type=admin&value=multiple&when=now&where=local&who=all" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d200

Sorry we were too eager to upgrade the docs with the latest instructions. I think it would be best to keep commands for older installation in the docs as well.
Hi, what is the command if I just want to do backup for one user, and except home directory and email data?
 
In that case, if it's only one user, easiest thing is login as the user and make a user backup, only select what you need.
 
In that case, if it's only one user, easiest thing is login as the user and make a user backup, only select what you need.
Hi, the problem is that my OS is too old, and now the directadmin license is expired, so I need to run a command line.
 
If you don't want to backup /home directory and email data, the only thing left is the databases, right? Or is there something else?

Databases can easily be backed up via commandline as root like this:
mysqldump -uusername -ppassword databasename >/backup/dump.sql
where username is ofcourse the mysql username of the user and the password is the database password of the database to be backed up.
Or you can use a little shorter:
mysqldump -uusername -p databasename >/backup/dump.sql
and then you will be prompted for the password after you hit enter.

Change the /backup/dump.sql to a path and file you like.
 
Hi, thanks for your reply.
I want to backup the email settings, eg, email address list and email address password
 
I want to backup the email settings, eg, email address list and email address password
Oh? That is not what you said before:
i, what is the command if I just want to do backup for one user, and except home directory and email data?

Try what it says in the docs, otherwise you can always use imapsync to transfer your email data.

Or use the full backup option here and just delete the /home stuff afterwards.
 
Hi Richard,
Thanks for your reply.
Sorry that my question is confusing.
in fact, what i want is:
backup per user (or all users), excluding the folder "domains" and "imap" under each user.

Now the problem in the full backup command, this one:
echo "action=backup&append%5Fto%5Fpath=nothing&database%5Fdata%5Faware=yes&email%5Fdata%5Faware=yes&local%5Fpath=%2Fhome%2Fadmin%2Fadmin%5Fbackups&owner=admin&type=admin&value=multiple&when=now&where=local&who=all" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d200

it backups all users in one time, but when some "domains" and "imap" are very large, then it will take a lot of time and the server will be very busy.

So I wonder if can slightly update the above command to just backup all users but exclude the folder "domains" and "imap"
 
Hi Richard,
Thanks for your reply.
Sorry that my question is confusing.
in fact, what i want is:
backup per user (or all users), excluding the folder "domains" and "imap" under each user.

Now the problem in the full backup command, this one:
echo "action=backup&append%5Fto%5Fpath=nothing&database%5Fdata%5Faware=yes&email%5Fdata%5Faware=yes&local%5Fpath=%2Fhome%2Fadmin%2Fadmin%5Fbackups&owner=admin&type=admin&value=multiple&when=now&where=local&who=all" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d200

it backups all users in one time, but when some "domains" and "imap" are very large, then it will take a lot of time and the server will be very busy.

So I wonder if can slightly update the above command to just backup all users but exclude the folder "domains" and "imap"
Hi @tsimtung, were you able to modify the echo line to backup some users without the domains and imap folders? Regards
 
Hi,
No, i am not able to do that.
Then I just move the imap and domains to another folder, eg, /root/, create an empty domains folder, and then run the line, after that, move back the useful domains and imap folder to that username.
 
Back
Top