Backup & restore

Hi,
I'm trying to backup and restore my site via the admin panel. The backup seems to be working fine but when I click on Restore, I didn't see any backup and I have the following message:


You can restore any of the backup packages found or remove it from the server.
0777

Problem The file/backup/ directory is not executable.

Can you tell me why this is happening. My wicki is installed in a Windows environment.


Thanks in advance.

Comments

  1. Re: Backup & restore

    The restore module does the following check before it throws that error message:
    $dir = UPLOAD_BACKUP_DIR . '/';
    
    if (!is_executable($dir))	


    So I guess you must make the folder executable for the user or usergroup you're in. Somehow this isn't the case yet. Please check your file permissions again.

    It seems there might be an issue unter Windows.
    https://www.php.net/manual/en/[...]on.is-executable.php

    Can't remember having issue with that, however I work mainly in a Unix environment.
    • WikiAdmin
    • 07.03.2023 16:18 edited
  2. Re: Backup & restore

    Thanks a lot for your response!

    Indeed, there seems to be a problem with this function under Windows. I changed the is_executable to if_writable in the module. Result: the backups are visible and the restore works.

    Do you think that could be a problem?
  3. Re: Backup & restore

    Yes, I checked this today on a Windows instance.

    diff --git a/src/admin/module/db_restore.php b/src/admin/module/db_restore.php
    index 00a81ff..b5c992e 100644
    --- a/src/admin/module/db_restore.php
    +++ b/src/admin/module/db_restore.php
    @@ -402,7 +402,7 @@
                 <?php echo $engine->_t('RestoreInfo'); ?>
             </p>
     <?php
    -        if (!is_executable($dir))
    +        if (!(PHP_OS_FAMILY === 'Windows') && !is_executable($dir))
             {
                 echo substr(sprintf('%o', fileperms($dir)), -4) . "<br>\n";
                 echo output_image($engine, false) .


    It seems is_executable() checks if the archives can be unpacked, which works only on Unix. This is the only call of this function in the code base. I think the check can be skiped for Windows. Did I miss something?

    The patch is now in the repository for the master and 6.0 branch.

    Thanks for reporting.

    • WikiAdmin
    • 11.11.2023 11:22 edited
Log in or create an account to post a comment.