enupal / backup

Fully integrated Backup solution for Craft CMS
https://enupal.com/craft-plugins/enupal-backup
Other
16 stars 3 forks source link

Only backs up database - Windows #30

Closed nitech closed 4 years ago

nitech commented 4 years ago

When I run a backup, only the db is backed up. I expected templates, assets etc to also be backed up.

Here's my settings:

Database: Yes Templates: Yes Assets: Yes Config Files: Yes Web Root Directory: No

image

Running a trial version locally.

Additional info

nitech commented 4 years ago

On the server it backs up everything however.

andrelopez commented 4 years ago

Hi @nitech This could be an issue on the latest Craft CMS version, to start debugging, could you please send back to us a zip file of storage/logs folder to support@enupal.com?

nitech commented 4 years ago

Done. I had a peek at storage/logs/enupalbackup and it revealed:

"errors": [
    {
        "class": "phpbu\\App\\Backup\\Sync\\Exception",
        "message": "target file 'assets-bilder-secret-nasa-system_20200624021341_vivi1yekzl.tar' doesn't exist",
        "file": "phar://C:/secret-nasa-system/secret-nasa-system/vendor/enupal/backup/src/resources/phpbu.phar/Backup/Sync/AmazonS3v3.php",
        "line": 73
    },
    {
        "class": "phpbu\\App\\Backup\\Sync\\Exception",
        "message": "target file 'config-translations-secret-nasa-system_20200624021341_vivi1yekzl.tar' doesn't exist",
        "file": "phar://C:/secret-nasa-system/secret-nasa-system/vendor/enupal/backup/src/resources/phpbu.phar/Backup/Sync/AmazonS3v3.php",
        "line": 73
    },
    {
        "class": "phpbu\\App\\Backup\\Sync\\Exception",
        "message": "target file 'config-configFolder-secret-nasa-system_20200624021341_vivi1yekzl.tar' doesn't exist",
        "file": "phar://C:/secret-nasa-system/secret-nasa-system/vendor/enupal/backup/src/resources/phpbu.phar/Backup/Sync/AmazonS3v3.php",
        "line": 73
    },
    {
        "class": "phpbu\\App\\Backup\\Sync\\Exception",
        "message": "target file 'config-composerFile-secret-nasa-system_20200624021341_vivi1yekzl.tar' doesn't exist",
        "file": "phar://C:/secret-nasa-system/secret-nasa-system/vendor/enupal/backup/src/resources/phpbu.phar/Backup/Sync/AmazonS3v3.php",
        "line": 73
    },
    {
        "class": "phpbu\\App\\Backup\\Sync\\Exception",
        "message": "target file 'templates-secret-nasa-system_20200624021341_vivi1yekzl.tar' doesn't exist",
        "file": "phar://C:/secret-nasa-system/secret-nasa-system/vendor/enupal/backup/src/resources/phpbu.phar/Backup/Sync/AmazonS3v3.php",
        "line": 73
    }
],

also /storage/enupalbackup/assets did not contain any tar-file. The only folder there with contents was the databases folder. Note that I am running Craft on Windows through WAMP - and I've had some struggles with paths. I ended up having to enter the path for mysqldump.exe into the settings window:

image

andrelopez commented 4 years ago

Glad to know that it is working on your server. On Windows, you may need to add the paths manually. Please follow our docs about how to add the paths on Windows. Please let us know how it goes.

nitech commented 4 years ago

Hi @andrelopez,

As of Windows 10 (build 17063) tar is included in Windows.

By adding the following paths:

image

I get the following log entries:

{
    "class": "phpbu\\App\\Backup\\Sync\\Exception",
    "message": "target file 'assets-bilder-amatec_automasjon_20200626024738_x3ag4lbny8.tar' doesn't exist",
    "file": "phar://C:/amatec/amatec_automasjon_craft_hyperlane/vendor/enupal/backup/src/resources/phpbu.phar/Backup/Sync/AmazonS3v3.php",
    "line": 73
}, ...

If I specify the filename of tar, like so C:\windows\system32\tar.exe I get an error in the log, saying;

{
    "class": "RuntimeException",
    "message": "wrong path specified for 'tar': C:\\Windows\\System32\\tar.exe",
    "file": "phar://C:/amatec/amatec_automasjon_craft_hyperlane/vendor/enupal/backup/src/resources/phpbu.phar/Util/Cli.php",
    "line": 126
}, ... 

cygwin works

I installed cygwin64 and changed the path to c:\cygwin54\bin, and now everything works.

Note that the requirements for paths are a bit inconsistent. PHP needs to be specified with php.exe as a part of the path, while MySqlDump and Tar requires you to omit the executable at the end of the path.