Drupal - How to get an import of a very large Drupal database working?

I'm not sure how much overhead drush puts on top of large SQL imports, I've only used it for smaller imports and queries. You can try the mysql client as an alternative that would remove the drush overhead.

If you can install pipe viewer on your VM you can view the progress of the command consuming the import.

pv mydb.sql | drush sql-cli

Or without the drush overhead

pv mydb.sql | mysql -u <DB_USER> -p<DB_PASS> <YOUR_DB>

Smaller databases will import more quickly, so drush cc all and drush watchdog delete all will speed things up considerably, if dropping these is an option.

Also, to expand on Shawn Conn's answer, you can use pipe viewer without the Drush overhead, and still use Drush to look up the database credentials for you if you use drush sql-connect instead of drush sql-cli. Just use $() to execute the mysql line that drush sql-connect prints out:

pv mydb.sql | $(drush sql-connect)

The Backup and Migrate module has a feature to exclude selected tables, such as:

  • all cache_* tables
  • ctools_views_cache
  • ctools_object_cache
  • flood
  • history
  • queue
  • semaphore
  • watchdog
  • search_index (usually saves a lot of database size!)

The issue about Default tables/data to exclude, also includes an interesting list of tables to not be migrated (pick what fits for you), i.e. (quote from it):

When creating a backup profile, the module by default sets the following tables to have their data excluded according to issue #209647: Exclude advice:

  • cache
  • cache_filter
  • cache_calendar_ical
  • cache_menu
  • cache_page
  • cache_views
  • sessions
  • search_dataset
  • search_index
  • search_keywords_log
  • search_total
  • watchdog
  • accesslog
  • devel_queries
  • devel_times