Closed (outdated)
Project:
Quickstart: Prebuilt Drupal Development Environment
Component:
Drush
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2011 at 10:50 UTC
Updated:
27 Jun 2018 at 12:55 UTC
Jump to comment: Most recent
Comments
Comment #1
MichaelCole commentedHi Crom, this is an interesting idea. Yes, it should do this, and would be easy to accomplish inside the drush command.
In the meantime, here's what I do in a shell script. This script backups up the database if the file doesn't exist, and restores it if it does:
Room for improvement, but this is a good start if you want to write a shell script yourself.
Cheers,
Mike
Comment #2
Crom commentedThanks Mike - I used the commands in your script to get what I wanted done which is great.
I've used a function within your quickstart.inc file and tweaked it to do the db check and backup. Some of the lines are specific to my requirements/setup but in case it's useful here it is - I'm sure it can ben improved but it works so happy for the moment ;-)
Can't work out how to configure that Drush y/n check but I'm only starting with drush...
Cheers,
Crom
Comment #3
MichaelCole commentedHi you might be able to change:
drush_backend_invoke("-r $codepath sql-dump --gzip --result-file=$logfilename");
to:
drush_backend_invoke("-y -r $codepath sql-dump --gzip --result-file=$logfilename");
Haven't tested it.
Comment #4
MichaelCole commentedComment #5
kenorb commentedIs the --gzip argument is supported? I can't find it in --help?
Comment #6
MichaelCole commentedUuuuuuhhhh.... Neither can I D-: It probably doesn't exist and is ignored. Examples online pipe through gzip. Mea culpa.
Comment #7
DjebbZ commentedIf I'm not mistaking, the "DROP database and CREATE a new one" stuff comes from the
drush site-installcommand. Should be better to file an issue there to change the options of the command, so thatdrush qcjust have to rely on it instead of "forking" it. I'm pretty sure there was already an issue in Drush about not DROPing the database but only the tables (found it : #1105514: site-install - Never try to drop an existing database. Just drop tables.). Drush folks may be happy about adding an option to back it up before.Comment #8
kenorb commentedDrupal 5 and Drupal 6 is no longer officially supported. If you think this issue is still relevant for 8.x, feel free to re-open.