Error during backup restauration

Hi,

I have 2 HestiaCP server and since a while, when I want to move a user from server A to server B, I get this error during backup restauration :

v-restore-user GDA GDA.2026-04-02_06-49-25.tar 
-- USER --
2026-04-02 10:05:37 GDA

-- WEB --
2026-04-02 10:05:40 domain.fr

-- DNS --

-- MAIL --

-- DB --
2026-04-02 10:05:48 GDA_domain
/backups/hestia/tmp.L4aEi0S2ow/db/GDA_domain/GDA_domain.mysql.sql.zst: 1615678 bytes 

-- CRON --
2026-04-02 10:05:49 0 cron jobs

-- USER FILES --
2026-04-02 10:05:49 .bashrc
2026-04-02 10:05:49 .config
2026-04-02 10:05:49 .bash_logout
2026-04-02 10:05:50 .cache
2026-04-02 10:05:50 .local
2026-04-02 10:05:50 .ssh
2026-04-02 10:05:50 .vscode-server
2026-04-02 10:05:50 .npm
2026-04-02 10:05:50 .wp-cli
2026-04-02 10:05:50 .composer
2026-04-02 10:05:50 .profile
sed: -e expression #1, char 3: unknown command: `
'
sed: -e expression #1, char 3: unknown command: `
'

On server A, the backup is done without error.
Do you have any idea from where this error comes from ?

Hi,

You can debug the restore to know where it fails:

bash -x v-restore-user GDA GDA.2026-04-02_06-49-25.tar 

Best guess: french locale/charset o one of the systems or some french special char in the username or stuff like that.

Thanks for you feedback.

I don’t have any speciual char on the user name as I can see.

Here the end of the restore command with bash -x :

+ chown -R GDA:GDA /home/GDA/tmp
+ rm -f /home/GDA/.ssh/hst-filemanager-key
+ subj='GDA → restore has been completed'
+ cat /backups/hestia/tmp.Fwuylqy2XD/restore.log
+ /usr/local/hestia/bin/v-add-user-notification GDA 'Backup restored successfully' '<p><span class='\''u-text-bold'\''>Archive:</span> <code>GDA.2026-04-09_10-30-29.tar</code></p>'
+ rm -rf /backups/hestia/tmp.Fwuylqy2XD
+ sed -i '/v-restore-user GDA /d' /usr/local/hestia/data/queue/backup.pipe
+ /usr/local/hestia/bin/v-update-user-counters GDA
+ /usr/local/hestia/bin/v-update-user-counters admin
sed: -e expression #1, char 3: unknown command: `
'
sed: -e expression #1, char 3: unknown command: `
'
+ /usr/local/hestia/bin/v-update-sys-ip-counters
+ /usr/local/hestia/bin/v-log-action system Info Backup 'Restored backup contents (User: GDA, Archive: GDA.2026-04-09_10-30-29.tar).'
+ /usr/local/hestia/bin/v-log-action GDA Info Backup 'Restored backup contents (Archive: GDA.2026-04-09_10-30-29.tar).'
+ log_event 0 ' '\''GDA'\'' '\''GDA.2026-04-09_10-30-29.tar'\'''
+ '[' -z '' ']'
++ date '+%F %T'
++ basename v-restore-user
+ LOG_TIME='2026-04-09 10:35:06 v-restore-user'
+ '[' 0 -eq 0 ']'
+ echo '2026-04-09 10:35:06 v-restore-user  '\''GDA'\'' '\''GDA.2026-04-09_10-30-29.tar'\'''
+ exit

Show the output of this command:

cat -A /usr/local/hestia/data/users/admin/user.conf

Note: If present, please redact the values of the following variables: MD5, RKEY, TWOFA, and QRCODE (only the content within single quotes).

NAME=‘System Administrator’$
PACKAGE=‘default’$
WEB_TEMPLATE=‘default’$
PROXY_TEMPLATE=‘default’$
BACKEND_TEMPLATE=‘default’$
DNS_TEMPLATE=‘default’$
WEB_DOMAINS=‘unlimited’$
WEB_ALIASES=‘unlimited’$
DNS_DOMAINS=‘unlimited’$
DNS_RECORDS=‘unlimited’$
MAIL_DOMAINS=‘unlimited’$
MAIL_ACCOUNTS=‘unlimited’$
RATE_LIMIT=‘200’$
DATABASES=‘unlimited’$
CRON_JOBS=‘unlimited’$
DISK_QUOTA=‘unlimited’$
BANDWIDTH=‘unlimited’$
NS=‘ns1.domain.net,ns2.domain.net’$
SHELL=‘nologin’$
BACKUPS=‘1’$
CONTACT=‘[email protected]’$
CRON_REPORTS=‘yes’$
MD5=‘’$
RKEY=‘’$
TWOFA=‘’$
QRCODE=‘’$
PHPCLI=‘’$
ROLE=‘admin’$
SUSPENDED=‘no’$
SUSPENDED_USERS=‘0’$
SUSPENDED_WEB=‘0’$
SUSPENDED_DNS=‘0’$
SUSPENDED_MAIL=‘0’$
SUSPENDED_DB=‘0’$
SUSPENDED_CRON=‘0’$
IP_AVAIL=‘1’$
IP_OWNED=‘1’$
U_USERS=‘17’$
U_DISK=‘12’$
U_DISK_DIRS=‘11’$
U_DISK_WEB=‘1’$
U_DISK_MAIL=‘0’$
U_DISK_DB=‘0’$
U_BANDWIDTH=‘1’$
U_WEB_DOMAINS=‘1’$
U_WEB_SSL=‘1’$
U_WEB_ALIASES=‘0’$
U_DNS_DOMAINS=‘0’$
U_DNS_RECORDS=‘0’$
U_MAIL_DOMAINS=‘0’$
U_MAIL_DKIM=‘0’$
U_MAIL_ACCOUNTS=‘0’$
RATE_LIMIT=‘200’$
U_MAIL_SSL=‘0’$
U_DATABASES=‘0’$
U_CRON_JOBS=‘0’$
U_BACKUPS=‘1’$
U_BACKUPS=‘1’$
THEME=‘’$
NOTIFICATIONS=‘yes’$
PREF_UI_SORT=‘name’$
LOGIN_DISABLED=‘’$
LOGIN_USE_IPLIST=‘’$
LOGIN_ALLOW_IPS=‘’$
TIME=‘19:35:41’$
DATE=‘2021-04-11’$

I can’t see any obvious issue, at least with the redacted output.

Show the output of this command:

bash -x /usr/local/hestia/bin/v-update-user-counters admin

Note: When pasting outputs here, once they are pasted, select the text and press Ctrl+e or click the </> button to format the output correctly.

First, the command without bash -x give this error :

sed: -e expression #1, char 3: unknown command: `
'
sed: -e expression #1, char 3: unknown command: `
'

And now the result with bash -x : kPaste – The solution for sending ephemeral messages in total security

The issue is that the user.conf file for user admin in your backup has the U_BACKUPS variable defined twice. The grep command is returning two line numbers (57 and 58) instead of one, which causes the subsequent sed commands to fail because they cannot handle the line break between the two values.

+ update_user_value admin '$U_BACKUPS' 1
+ key=U_BACKUPS
++ cut -f 1 -d :
++ grep -n '^U_BACKUPS='\''' /usr/local/hestia/data/users/admin/user.conf
+ lnr='57
58'
+ '[' -n '57
58' ']'
+ sed -i '57
58 d' /usr/local/hestia/data/users/admin/user.conf
sed: -e expression #1, char 3: unknown command: `
'
+ sed -i '57
58 i\U_BACKUPS='\''1'\''' /usr/local/hestia/data/users/admin/user.conf
sed: -e expression #1, char 3: unknown command: `

Oh !

It’s working now !

Thanks a lot !

1 Like