0

I'm having a hard time with buggy modules and need to do a lot of installs, uninstalls and so on.

But even if I uninstall, the modules leave data on the SQL file, and the only way to start from scratch is a new install every time...

How can I save SQL files that will delete ALL older data when imported?

An fresh SQL file that doesn't contain any data of newly installed and uninstalled modules.

I've tried add drop dables and other settings, but it seems that once you install a module...it's too late..it keeps creeping back into the database, sometimes form dependencies also?

1 Answer 1

1

You can use drush:

drush sql-drop; drush sqlc < path/to/sql/dump/file.sql

Understand it will drop your entire Drupal db and the second command will rebuild it from your dump file.

You can create a base dump from:

drush sql-dump > path/to/save/dump.sql

Here's the link to the drush commands website, select sql from the menu on the left drush commands

4
  • Hi Sean, sounds good. Just to confirm: STEP ONE drush sql-dump > path/to/save/dump.sql and STEP TWO drush sql-drop; drush sqlc < path/to/sql/dump/file.sql and that's it? Commented Aug 23, 2015 at 9:04
  • Dump file is generated by sql-dump > path/to/save/file.sql, to restore it use drush sqlc < /path/to/dump/file.sql. Hth! Commented Aug 23, 2015 at 9:08
  • Bruno, I misread your comment initially. Yes, the way you outlined the steps is correct. Commented Aug 23, 2015 at 9:32
  • @BrunoVincent did that solution work out for you? I didn't hear anything back afterward. Hopefully it was exactly what you were looking for. Commented Aug 23, 2015 at 23:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.