We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We are using postgres instead of mysql. Currently, the mysqldump command is hardcoded in the the default ExportService.
Here's what we did to support postgres export / import:
ExportService:php
public function exportDatabase() { $command = "PGPASSWORD=" . escapeshellarg($this->databasePassword) . " pg_dump -h " . escapeshellarg($this->databaseHost) . " -U " . escapeshellarg($this->databaseUser) . " -d " . escapeshellarg($this->databaseName) . " -F c -b -v -f " . escapeshellarg($this->exportDirectory . \DIRECTORY_SEPARATOR . ImportExportDefaultMap::FILENAME_SQL); $process = Process::fromShellCommandline($command); $process->run(); if (!$process->isSuccessful()) { throw new \RuntimeException($process->getErrorOutput()); } }
ImportService.php:
public function importDatabase() { $command = "PGPASSWORD=" . escapeshellarg($this->databasePassword) . " pg_restore -h " . escapeshellarg($this->databaseHost) . " -U " . escapeshellarg($this->databaseUser) . " -d " . escapeshellarg($this->databaseName) . " --clean --if-exists -v " . escapeshellarg($this->importDirectory . \DIRECTORY_SEPARATOR . ImportExportDefaultMap::FILENAME_SQL); $process = Process::fromShellCommandline($command); $process->run(); if (!$process->isSuccessful()) { throw new \RuntimeException($process->getErrorOutput()); } }
this adds a dependency on the pg_dump and pg_restore binaries. On Mac, you usually install them like this:
pg_dump
pg_restore
brew install libpq brew link --force libpq
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We are using postgres instead of mysql. Currently, the mysqldump command is hardcoded in the the default ExportService.
Here's what we did to support postgres export / import:
ExportService:php
ImportService.php:
this adds a dependency on the
pg_dump
andpg_restore
binaries. On Mac, you usually install them like this:The text was updated successfully, but these errors were encountered: