Page 9 of 10

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Sun Apr 09, 2017 9:40 am
by skamasle
dpeca wrote:Please test scenario where (in cPanel) the same mysql user is used for two databases, or one database has granted to two different mysql users.
I noticed that importer script creates the same database two times in db.conf, and it brakes backup system.
In my test there is no issue if one user is asigned to multiple databases, I have a backup with 5 databases, one user is used in 3 of 5

But I not test never if database have multiple users asigned, but I cant do nothing for this if vesta not support it, just recomended user leave one user per database before do a backup.

I have some issues with default user, and I remove it for same issue

Code: Select all

# default cpanel user has all database privileges
# if you use default user in your config files to connect with database
# you will need remove && [ "$userdb" != "$sk_cp_user" ] to restore main user, but
# this will cause database duplication in db.conf and will interfer with vestacp backups 
			if [ "$userdb" == "$user" ] && [ "$userdb" != "$sk_cp_user" ] && [ "$userdb" != "$sk_real_cp_user" ] ; then
				echo "DB='$db' DBUSER='$userdb' MD5='$end_user_pass' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='0' SUSPENDED='no' TIME='$TIME' DATE='$DATE'" >> /usr/local/vesta/data/users/${sk_cp_user}/db.conf
			fi
		done
done

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Sun Apr 09, 2017 1:38 pm
by dpeca
I found a vesta backup.log, to help you to figure out how it breaks the backup.

So, in /usr/local/vesta/log/backup.log i found this:
-- DB --
2017-03-29 23:19:10 novisind_nst (mysql)
2017-03-29 23:19:10 novisind_nst (mysql)
gzip: /backup/tmp.T9RmIk9lg1/db/novisind_nst/novisind_nst.mysql.sql.gz already exists; do you wish to overwrite (y or n)?
That was last line of backup.log - so it means that backup script get stuck there.
Vesta backup script wait for y/n response (do you wish to overwrite (y or n)).

In /usr/local/vesta/data/users/novisad/db.conf I found elfi83_db1 two times, in two lines, with different mysql users - I'm talking this from my remember, dont trust me 100% about different mysql users.

System is Debian 8.7.
Maybe it's not reproducible on CentOS.

Probably two different mysql users was granted to the same database in cPanel, I guess.

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Sun Apr 09, 2017 5:58 pm
by skamasle
dpeca wrote:I found a vesta backup.log, to help you to figure ot how it breaks the backup.

So, in /usr/local/vesta/log/backup.log i found this:
-- DB --
2017-03-29 23:19:10 novisind_nst (mysql)
2017-03-29 23:19:10 novisind_nst (mysql)
gzip: /backup/tmp.T9RmIk9lg1/db/novisind_nst/novisind_nst.mysql.sql.gz already exists; do you wish to overwrite (y or n)?
That was last line of backup.log - so it means that backup script get stucked there.
Vesta backup script wait for y/n response (do you wish to overwrite (y or n)).

In /usr/local/vesta/data/users/novisad/db.conf I found elfi83_db1 two times, in two lines, with different mysql users - I'm talking this from my remember, dont trust me 100% about different mysql users.

System is Debian 8.7.
Maybe it's not reproducible on CentOS.

Probably two different mysql users was granted to the same database in cPanel, I guess.

Yes this can happen, but this cant be fixed, vesta not suport it, I can only add one check, if database exists in db.conf not add more dbs with same name only restore, but this can break something in future.

In any case vesta cant handle this, uniq option is add this to faq as warning / notice and try fix in code for not add same database two times.

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Sun Apr 09, 2017 6:09 pm
by dpeca
Maybe Vesta backup script should be fixed.
If I'll have a time I will try to add parameter to gzip (in vesta backup script) to prevent blocking.

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Sun Apr 09, 2017 8:15 pm
by skamasle
dpeca wrote:Maybe Vesta backup script should be fixed.
If I'll have a time I will try to add parameter to gzip (in vesta backup script) to prevent blocking.
Backup need a lot of fixes -> https://bugs.vestacp.com/issues/517

Backup also fail if you have corrupted database or some broken nginx vhost.

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Tue Apr 11, 2017 3:19 pm
by dmitry.vd
skamasle wrote:I cant reproduce this yet. I will test with more backups
If it helps I can send you cPanel back up link using private message.

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Wed Apr 12, 2017 7:23 am
by skamasle
dmitry.vd wrote:
skamasle wrote:I cant reproduce this yet. I will test with more backups
If it helps I can send you cPanel back up link using private message.
Ok send me it, I will investigate when get some time this week

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Fri Apr 14, 2017 10:04 am
by dmitry.vd
skamasle wrote:
dmitry.vd wrote:
skamasle wrote:I cant reproduce this yet. I will test with more backups
If it helps I can send you cPanel back up link using private message.
Ok send me it, I will investigate when get some time this week

Sent private message.

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Fri May 05, 2017 7:09 pm
by skamasle
I think this is stable now

So maybe this need be closed :)

Re: SK-cPanel-Importer | Restore cPanel Backup on Vesta

Posted: Tue Aug 29, 2017 9:45 pm
by bdacus01
Typo

rsync not installed, try install it
This script need: rsync, file
#######################################
Run: yum install rync file