Author Topic: [SOLVED] Error Restore Backup in Zentyal 6  (Read 1243 times)

felipemb

  • Zen Monk
  • **
  • Posts: 62
  • Karma: +1/-0
  • La base del conocimiento + experiencia = TODOO!
    • View Profile
[SOLVED] Error Restore Backup in Zentyal 6
« on: June 18, 2019, 03:04:13 am »
Hello,

I have a problem with Zentyal 5, I tried to update to version 6 but it resulted in errors and the operating system was damaged ... :(

I have installed version 6 to restore my backup but I get an error that is not possible because it was generated with version 5.

--
Some error has happened in Zentyal:

Could not restore the backup because a mismatch between its Zentyal version and the current system version. Backup was done in Zentyal version 5.1.1 and this system could only restore backups from Zentyal version 6.0

--

How can I do to restore my backup in this case?


Thanks!! :)
« Last Edit: July 07, 2019, 10:32:55 pm by felipemb »
Siempre con la mente clara!

doncamilo

  • Zen Warrior
  • ***
  • Posts: 242
  • Karma: +56/-0
    • View Profile
Re: Error Restore Backup in Zentyal 6
« Reply #1 on: June 18, 2019, 10:45:16 am »
I think you should stablish what was wrong while your upgrading process.

Check the logs on your broken Zentyal 6.0. and give us the errors:

Code: [Select]
less /var/log/zentyal/zentyal.log

Cheers!

felipemb

  • Zen Monk
  • **
  • Posts: 62
  • Karma: +1/-0
  • La base del conocimiento + experiencia = TODOO!
    • View Profile
Re: Error Restore Backup in Zentyal 6
« Reply #2 on: June 20, 2019, 09:17:52 pm »
thank you very much for your answer doncamilo

This is the result of zentyal.log:

Code: [Select]
2019/06/20 14:11:19 DEBUG> Backup.pm:1004 EBox::Backup::_checkZentyalVersion - Could not restore the backup because a mismatch between its Zentyal version and the current system version. Backup was done in Zentyal version 5.1.1 and this system could only restore backups from Zentyal version 6.0 at Could not restore the backup because a mismatch between its Zentyal version and the current system version. Backup was done in Zentyal version 5.1.1 and this system could only restore backups from Zentyal version 6.0 at /usr/share/perl5/EBox/Backup.pm line 1004
EBox::Backup::_checkZentyalVersion('EBox::Backup', '/var/lib/zentyal/tmp//backup.TZcEus') called at /usr/share/perl5/EBox/Backup.pm line 849
eval {...} at /usr/share/perl5/EBox/Backup.pm line 838
EBox::Backup::_unpackAndVerify('EBox::Backup', '/var/lib/zentyal/tmp/path', 'deleteBackup', 0, 'progress', 'EBox::ProgressIndicator=HASH(0x565257108ba0)', 'revokeAllOnModuleFail', 1, 'forceZentyalVersion', 0, 'dataRestore', 1, 'forceDependencies', 0, 'continueOnModuleFail', 0, 'installMissing', 0, 'modsToExclude', 'ARRAY(0x565256eac048)') called at /usr/share/perl5/EBox/Backup.pm line 1169
eval {...} at /usr/share/perl5/EBox/Backup.pm line 1163
EBox::Backup::restoreBackup('EBox::Backup', '/var/lib/zentyal/tmp/path', 'forceDependencies', 0, 'continueOnModuleFail', 0, 'installMissing', 0, 'dataRestore', 1, 'forceZentyalVersion', 0, 'deleteBackup', 0, 'revokeAllOnModuleFail', 1, 'progress', 'EBox::ProgressIndicator=HASH(0x565257108ba0)') called at /usr/share/zentyal/restore-backup line 105
eval {...} at /usr/share/zentyal/restore-backup line 104
2019/06/20 14:12:09 DEBUG> Backup.pm:1004 EBox::Backup::_checkZentyalVersion - Could not restore the backup because a mismatch between its Zentyal version and the current system version. Backup was done in Zentyal version 5.1.1 and this system could only restore backups from Zentyal version 6.0 at Could not restore the backup because a mismatch between its Zentyal version and the current system version. Backup was done in Zentyal version 5.1.1 and this system could only restore backups from Zentyal version 6.0 at /usr/share/perl5/EBox/Backup.pm line 1004
EBox::Backup::_checkZentyalVersion('EBox::Backup', '/var/lib/zentyal/tmp//backup.pdaCQx') called at /usr/share/perl5/EBox/Backup.pm line 849
eval {...} at /usr/share/perl5/EBox/Backup.pm line 838
EBox::Backup::_unpackAndVerify('EBox::Backup', '/var/lib/zentyal/tmp/path', 'revokeAllOnModuleFail', 1, 'dataRestore', 1, 'forceDependencies', 0, 'installMissing', 0, 'deleteBackup', 0, 'continueOnModuleFail', 0, 'forceZentyalVersion', 0, 'modsToExclude', 'ARRAY(0x55c65c06a3f0)', 'progress', 'EBox::ProgressIndicator=HASH(0x55c65c0514d8)') called at /usr/share/perl5/EBox/Backup.pm line 1169
eval {...} at /usr/share/perl5/EBox/Backup.pm line 1163
EBox::Backup::restoreBackup('EBox::Backup', '/var/lib/zentyal/tmp/path', 'progress', 'EBox::ProgressIndicator=HASH(0x55c65c0514d8)', 'continueOnModuleFail', 0, 'forceZentyalVersion', 0, 'installMissing', 0, 'deleteBackup', 0, 'revokeAllOnModuleFail', 1, 'forceDependencies', 0, 'dataRestore', 1) called at /usr/share/zentyal/restore-backup line 105
eval {...} at /usr/share/zentyal/restore-backup line 104
2019/06/20 14:13:31 DEBUG> Backup.pm:1004 EBox::Backup::_checkZentyalVersion - Could not restore the backup because a mismatch between its Zentyal version and the current system version. Backup was done in Zentyal version 5.1.1 and this system could only restore backups from Zentyal version 6.0 at Could not restore the backup because a mismatch between its Zentyal version and the current system version. Backup was done in Zentyal version 5.1.1 and this system could only restore backups from Zentyal version 6.0 at /usr/share/perl5/EBox/Backup.pm line 1004
EBox::Backup::_checkZentyalVersion('EBox::Backup', '/var/lib/zentyal/tmp//backup.p738fv') called at /usr/share/perl5/EBox/Backup.pm line 849
eval {...} at /usr/share/perl5/EBox/Backup.pm line 838
EBox::Backup::_unpackAndVerify('EBox::Backup', '/var/lib/zentyal/tmp/path', 'dataRestore', 1, 'revokeAllOnModuleFail', 1, 'deleteBackup', 0, 'progress', 'EBox::ProgressIndicator=HASH(0x5576e0281b60)', 'forceDependencies', 0, 'installMissing', 0, 'forceZentyalVersion', 0, 'continueOnModuleFail', 0, 'modsToExclude', 'ARRAY(0x5576e028ee10)') called at /usr/share/perl5/EBox/Backup.pm line 1169
eval {...} at /usr/share/perl5/EBox/Backup.pm line 1163
EBox::Backup::restoreBackup('EBox::Backup', '/var/lib/zentyal/tmp/path', 'installMissing', 0, 'revokeAllOnModuleFail', 1, 'dataRestore', 1, 'progress', 'EBox::ProgressIndicator=HASH(0x5576e0281b60)', 'forceDependencies', 0, 'deleteBackup', 0, 'continueOnModuleFail', 0, 'forceZentyalVersion', 0) called at /usr/share/zentyal/restore-backup line 105
eval {...} at /usr/share/zentyal/restore-backup line 104


I see that the problem is because the backup is of version 5.1 and the new installation is 6.0.1 ...

Is there a way to restore an old backup in version 6?

Thank you!
Siempre con la mente clara!

doncamilo

  • Zen Warrior
  • ***
  • Posts: 242
  • Karma: +56/-0
    • View Profile
Re: Error Restore Backup in Zentyal 6
« Reply #3 on: June 20, 2019, 11:21:18 pm »
Hi!

Yes, the upgrading script checks the bundle version.  Here https://github.com/zentyal/zentyal/blob/master/main/core/src/scripts/restore-backup you have the code for importing config backups and here https://github.com/zentyal/zentyal/blob/master/main/core/src/EBox/Backup.pm the sub restoreBackup that does the work.

This subrutine has this header:

Code: [Select]
# Method: restoreBackup
#
#       Restores a backup from file
#
# Parameters:
#
#       file - backup's file (as positional parameter)
#       progressIndicator - Progress indicator associated
#                       with this operation (optional )
#       forceDependencies - wether ignore dependency errors between modules  ;)
#       forceZentyalVersion - ignore zentyal version check
#       deleteBackup      - deletes the backup after resroting it or if the process is aborted
#       revokeAllOnModuleFail - whether to revoke all restored configuration
#                              when a module restoration fail
#       continueOnModuleFail - wether continue when a module fails to restore
#                              (default: false)
#       modsToRestore      - names of modules to restore (default: all)
#       modsToExclude      - name of modules to exclude fro the restore (default:none)
#
# Exceptions:
#
#       External - If it can't unpack de backup
#


So, I think that you could fix this parameter to 1 on the restore-backup script to skip this version check. Could be possible but I haven't  never try it.

Code: [Select]
my $progressId = undef;
my @modsToRestore = ();
my @modsToExclude = ();

my $deleteBackup = 0;

my $forceDependencies = 0;
my $forceZentyalVersion = 0; [b]-----> This should be 1[/b]
my $revokeAllOnModuleFail = 1;
my $continueOnModuleFail = 0;
my $dataRestore = 1;
my $installMissing = 0;

my $help = 0;;
my $info = 0;

But I think that your better option is to import your config-backup to a fresh install Zentyal 5.1, check all your logs to be sure that all runs rightly and to proceed to do the upgrade.

Tell me about your advances and count on me if I can give your some help.

Best regards!

felipemb

  • Zen Monk
  • **
  • Posts: 62
  • Karma: +1/-0
  • La base del conocimiento + experiencia = TODOO!
    • View Profile
Re: Error Restore Backup in Zentyal 6
« Reply #4 on: July 07, 2019, 10:31:33 pm »
Thanks doncamilo! My solution was to update from version 5.1 to 6, but i had several problems that i was finally able to solve!

Regars!  ;)
Siempre con la mente clara!

OscarSNM

  • Zen Apprentice
  • *
  • Posts: 8
  • Karma: +1/-0
    • View Profile
Re: [SOLVED] Error Restore Backup in Zentyal 6
« Reply #5 on: July 31, 2019, 09:20:27 pm »
Felipe. I've done a backup from 5.1 and restore on 6.0 without problem. The trick is to check if all installed service are available on 6.0. I've done this from 4.2 to 5.1 and then to 6.0. Some services were discontinued so I've uninstalled from the old server before back it up and then I could restored it on the new server without problem.