dizda / CloudBackupBundle

Be able to backup your database(s) and upload it to the cloud (Dropbox, Amazon S3, GoogleDrive, etc.)
MIT License
196 stars 57 forks source link

Errors on Windows 8 #129

Open micayael opened 7 years ago

micayael commented 7 years ago

Hi.

I am using this bundle on unix and it's great! Now I want to use it on windows and I have two errors:

  1. It says that "export" is a not found command. I am debugging and I see this command:
export PGPASSWORD="postgres" && pg_dump --username "postgres" --host 127.0.0.1 --port 5432 --format plain --encoding UTF8 "prest" > "file.sql"

I understand that windows does't use export. Is there a way to use it in windows.

I found this line at Dizda\CloudBackupBundle\Database\BaseDatabase

$process = new Process($command, null, null, null, $this->timeout);

The environment variables shoudn't be at the third argumen for compatibility as an array?

  1. It says that pg_dump is not found and I already added the "POSTGRES\bin" directory on $PATH

Is there a way to help me?

This is my config

dizda_cloud_backup:
    output_file_prefix: localhost
    timeout: 300
    restore: true
    processor:
        type: zip
        options:
            compression_ratio: 6
            password: "%secret%"
            split:
                enable: false
                split_size: 1000
                storages: [Dropbox]
    folders: []
    cloud_storages:
        dropbox_sdk:
            remote_path: /backups
            access_token: "%token%"
    databases:
        postgresql:
            database: "%database_name%"
            db_host: "%database_host%"
            db_port: "%database_port%"
            db_user: "%database_user%"
            db_password: "%database_password%"
micayael commented 7 years ago

I do some hot fix here for the fist problem

micayael commented 7 years ago

ping @dizda

dizda commented 7 years ago

Hey there,

Have you seen this?

http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-windows-command-line-and-registry/ And that: http://symfony.com/doc/current/configuration/external_parameters.html

micayael commented 7 years ago

Hi @dizda, thanks for reply. I know that I can use those options for setting an environment variable. The problem is that the command generated for the bundle is this:

export PGPASSWORD="postgres" && pg_dump --username "postgres" --host 127.0.0.1 --port 5432 --format plain --encoding UTF8 "prest" > "file.sql"

It begins with export so windows throws an error.