I can't find anywhere how to use "--exclude". When I try this code
heroku help db:pull
I get this:
Usage: heroku db:pull [DATABASE_URL]
pull heroku data down into your local database
DATABASE_URL should reference your local database. if not specified, it
will be guessed from config/database.yml
-c, --chunksize SIZE # specify the number of rows to send in each batch
-d, --debug # enable debugging output
-e, --exclude TABLES # exclude the specified tables from the pull
-f, --filter REGEX # only pull certain tables
-r, --resume FILE # resume transfer described by a .dat file
-t, --tables TABLES # only pull the specified tables
ok I understand how to use "-e" with one table, but I want to exclude more than one table. It is not working:
heroku db:pull -e users, versions
mysqldump --no-data db_name > export.sql mysqldump --no-create-info --ignore-table=db_name.table_name db_name >> export.sql if you want to exclude more than 1 table, simply use the --ignore-table directive more often (in the 2nc command) - see mysqldump help: --ignore-table=name Do not dump the specified table.
--ignore-table=name Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names, e.g., --ignore-table=database.table
mysqldump --ignore-table=db_name.table_name db_name > export.sql mysqldump --no-data db_name table_name >> export.sql This is a better answer because it skips the unwanted data but gets the wanted schema, and I like that it still makes one file. Note that you can the use --ignore-table option multiple times to ignore multiple tables.
It works for me
heroku db:pull -e "stats admins" --app APP_NAME
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With