Guest User

Untitled

a guest
Nov 18th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. #!/bin/bash
  2. PASSWORD=$CODECEPT_DB_PASSWORD
  3. HOST=$CODECEPT_DB_HOST
  4. USER=$CODECEPT_DB_USER
  5. DATABASE=$CODECEPT_DB_NAME
  6. DB_FILE=dump.sql
  7.  
  8. EXCLUDED_TABLES=(
  9. be_sessions
  10. cache_md5params
  11. cache_treelist
  12. cf_cache_hash
  13. cf_cache_hash_tags
  14. cf_cache_imagesizes
  15. cf_cache_imagesizes_tags
  16. cf_cache_pages
  17. cf_cache_pages_tags
  18. cf_cache_pagesection
  19. cf_cache_pagesection_tags
  20. cf_cache_rootline
  21. cf_cache_rootline_tags
  22. cf_extbase_datamapfactory_datamap
  23. cf_extbase_datamapfactory_datamap_tags
  24. cf_extbase_object
  25. cf_extbase_object_tags
  26. cf_extbase_reflection
  27. cf_extbase_reflection_tags
  28. cf_extbase_typo3dbbackend_queries
  29. cf_extbase_typo3dbbackend_queries_tags
  30. cf_lfeditor_select_options_cache
  31. cf_lfeditor_select_options_cache_tags
  32. cf_tx_solr
  33. cf_tx_solr_configuration
  34. cf_tx_solr_configuration_tags
  35. cf_tx_solr_tags
  36. cf_vhs_main
  37. cf_vhs_main_tags
  38. cf_vhs_markdown
  39. cf_vhs_markdown_tags
  40. sys_history
  41. sys_log
  42. tx_rsaauth_keys
  43. tx_realurl_uniqalias
  44. tx_realurl_uniqalias_cache_map
  45. tx_solr_cache
  46. tx_solr_cache_tags
  47. tx_solr_indexqueue_indexing_property
  48. tx_solr_indexqueue_item
  49. tx_solr_last_searches
  50. tx_solr_statistics
  51. )
  52.  
  53. IGNORED_TABLES_STRING=''
  54. for TABLE in "${EXCLUDED_TABLES[@]}"
  55. do :
  56. IGNORED_TABLES_STRING+=" --ignore-table=${DATABASE}.${TABLE}"
  57. done
  58.  
  59. echo "structure"
  60. mysqldump --host=${HOST} --user=${USER} --password=${PASSWORD} --single-transaction --no-data ${DATABASE} --ignore-table=${DATABASE}.be_sessions > ${DB_FILE}
  61.  
  62. echo "be_sessions structure"
  63. mysqldump --host=${HOST} --user=${USER} --password=${PASSWORD} --single-transaction --skip-add-drop-table --no-data ${DATABASE} be_sessions | sed 's/^CREATE TABLE /CREATE TABLE IF NOT EXISTS /' >> ${DB_FILE}
  64.  
  65. echo "content"
  66. mysqldump --host=${HOST} --user=${USER} --password=${PASSWORD} ${DATABASE} --no-create-info ${IGNORED_TABLES_STRING} >> ${DB_FILE}
Add Comment
Please, Sign In to add comment