We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on Vesta 2.0 and expect to release it by the end of 2024. Read more about it: https://vestacp.com/docs/vesta-2-development
Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
Hi
Im working in new script to help people move to vestacp, now I do DirectAdmin importer ( similar to Cpanel Importer )
For now I need a lite help, I need to do some test more in this script whit diferent backups if some body can help and send some backupwhit out sensible data, just backups from user account whit some domains, subdominios, databases etc whit no real information will help a lot.
At this time script can do this:
-Restore full User level account.
-Restore domains and web site files.
-Restore databases, mysql user and passwords.
-Restore Mails accounts whit mail passwords.
What script cant do:
- Restore subdomains -> I not know how subdomains work in DA because I only have backups from DA whit domains, there is no subdomain options in my DA backups so, I Think script need some lines of code to fix this and I will add it when I get new backups whit more content.
-Crons, SSL and some orther features will be added later.
First realease ready!
En español -> https://www.skamasle.com/migrar-cuenta- ... a-vestacp/
Im working in new script to help people move to vestacp, now I do DirectAdmin importer ( similar to Cpanel Importer )
For now I need a lite help, I need to do some test more in this script whit diferent backups if some body can help and send some backupwhit out sensible data, just backups from user account whit some domains, subdominios, databases etc whit no real information will help a lot.
At this time script can do this:
-Restore full User level account.
-Restore domains and web site files.
-Restore databases, mysql user and passwords.
-Restore Mails accounts whit mail passwords.
What script cant do:
- Restore subdomains -> I not know how subdomains work in DA because I only have backups from DA whit domains, there is no subdomain options in my DA backups so, I Think script need some lines of code to fix this and I will add it when I get new backups whit more content.
-Crons, SSL and some orther features will be added later.
First realease ready!
En español -> https://www.skamasle.com/migrar-cuenta- ... a-vestacp/
Last edited by skamasle on Wed Feb 15, 2017 7:25 pm, edited 1 time in total.
Re: Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
First alpha is here if some body whant test it
Runt at your own risk
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. http://www.gnu.org/licenses/
This is alpha, report any problem here.
Runt at your own risk
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. http://www.gnu.org/licenses/
Code: Select all
cd /root/
wget mirror.skamasle.com/vestacp/skdaimporter/sk_da_importer.sh
bash sk_da_importer.sh da-user-backup.tar.gz
Re: Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
This was updated, if importer not working ( not restore domains )
You can set sk_get_dom=2 to try get domain list from domain dir directly
Changes in
https://github.com/Skamasle/sk_da_importer
You can set sk_get_dom=2 to try get domain list from domain dir directly
Changes in
https://github.com/Skamasle/sk_da_importer
Re: Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
Great job!
This script works as described.
Everything gets restored.
I changed sk_get_dom to 2.
Keep up the good work!
Thanks
This script works as described.
Everything gets restored.
I changed sk_get_dom to 2.
Keep up the good work!
Thanks
Re: Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
There is a issue with centos 6 because use old bash, if some body get this:
There is a fix in github, remplacing on line 122:
for
Working fine in bash 4.4 and will fail in bash 4.2 and older maybe in bash 4.3.. ( not tested )
Code: Select all
Substring expresion -5: substring expression < 0
Code: Select all
userdb=${sk_da_db_u:: -5}
Code: Select all
userdb=$(echo $sk_da_db_u |sed "s/.conf//")
Re: Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
Hi,
I've been struggling with this script for some time now as the migration didn't complete.
I've looked in de script and found that the imap function is looking for accounts in the backup folder.
After some searching I found an easy solution.
In your directadmin.conf add
direct_imap_backup=0
# cd /usr/local/directadmin/conf/
# nano directadmin.conf
Save config ( ctrl X -> Y ) and restart directadmin
# service directadmin restart
Create your user backups which will include the imap accounts in the backup folder of the tar.
Now the importer works fine for normal user accounts.
I've been struggling with this script for some time now as the migration didn't complete.
I've looked in de script and found that the imap function is looking for accounts in the backup folder.
After some searching I found an easy solution.
In your directadmin.conf add
direct_imap_backup=0
# cd /usr/local/directadmin/conf/
# nano directadmin.conf
Save config ( ctrl X -> Y ) and restart directadmin
# service directadmin restart
Create your user backups which will include the imap accounts in the backup folder of the tar.
Now the importer works fine for normal user accounts.
Re: Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
2infinity wrote:Hi,
I've been struggling with this script for some time now as the migration didn't complete.
I've looked in de script and found that the imap function is looking for accounts in the backup folder.
After some searching I found an easy solution.
In your directadmin.conf add
direct_imap_backup=0
# cd /usr/local/directadmin/conf/
# nano directadmin.conf
Save config ( ctrl X -> Y ) and restart directadmin
# service directadmin restart
Create your user backups which will include the imap accounts in the backup folder of the tar.
Now the importer works fine for normal user accounts.
Hi thanks for advice
Directadmin change some options in in their sistem and have a lot of config options, this script will fail in some cases
If you have full backup type not supported by this script you can sendme it and when I get some time I will add support for it.
Re: Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
From DA website. direct_imap_backup is feature works as below.
New option, disabled by default:
direct_imap_backup=0
but can be enabled by adding:
direct_imap_backup=1
into your directadmin.conf.
When enabled, this feature will store the "imap" folder directly into the tar.gz backup file, saving the need to first copy all emails to an assembly area.
This should greatly speed up the backup process.
Previously, the /home/user/imap/domain.com/* data was stored in:
backup/domain.com/email/data/imap/*
but when this feature is enabled, a file:
backup/domain.com/email/data/imap/.direct_imap_backup
will be created, telling DA to extract:
imap/*
to /home/user/imap/*
For security reasons, the extraction is done as user:user, and not user:mail.
Then a secure recursive chown is done whereby it temporarily renames each file to a random value, checks for hardlinks, and checks for user:user ownership.
If all passes, it's then lchown, and renamed back.
The reason for the excessive checks is anytime a recrsive chown is done on files that can be controlled by a User, there is a risk of hardlinks being added, where DA might end up doing a chown on /etc/shadow, for example,
but there can also be a race condition where the client creates the hardlink after the check in DA is done, but before the chown happens, hence we need to rename the file to prevent that, as the client won't be able to predict the filename.
Currently, only /home/user/imap is done this way.
The /home/user/Maildir folder is still stored in the home.tar.gz (for now)
New option, disabled by default:
direct_imap_backup=0
but can be enabled by adding:
direct_imap_backup=1
into your directadmin.conf.
When enabled, this feature will store the "imap" folder directly into the tar.gz backup file, saving the need to first copy all emails to an assembly area.
This should greatly speed up the backup process.
Previously, the /home/user/imap/domain.com/* data was stored in:
backup/domain.com/email/data/imap/*
but when this feature is enabled, a file:
backup/domain.com/email/data/imap/.direct_imap_backup
will be created, telling DA to extract:
imap/*
to /home/user/imap/*
For security reasons, the extraction is done as user:user, and not user:mail.
Then a secure recursive chown is done whereby it temporarily renames each file to a random value, checks for hardlinks, and checks for user:user ownership.
If all passes, it's then lchown, and renamed back.
The reason for the excessive checks is anytime a recrsive chown is done on files that can be controlled by a User, there is a risk of hardlinks being added, where DA might end up doing a chown on /etc/shadow, for example,
but there can also be a race condition where the client creates the hardlink after the check in DA is done, but before the chown happens, hence we need to rename the file to prevent that, as the client won't be able to predict the filename.
Currently, only /home/user/imap is done this way.
The /home/user/Maildir folder is still stored in the home.tar.gz (for now)
Re: Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
I have a DA backup if you tell me how you want it I will send you one.
Re: Sk-DirectAdmin-Importer | Script to Restore DirectAdmin User Account In VestaCP
hi
i got this error :
Start Whit Databases
Get local databases
sk_da_importer.sh: line 120: -5: substring expression < 0
just user created with no file or database
hope this script will be update ASAP.
i got this error :
Start Whit Databases
Get local databases
sk_da_importer.sh: line 120: -5: substring expression < 0
just user created with no file or database
hope this script will be update ASAP.