... | ... | @@ -18,7 +18,8 @@ Connect to your temp database, and execute those queries |
|
|
```sql
|
|
|
-- clean DB tables based on node id
|
|
|
TRUNCATE field_data_field_form1_expiration, field_data_field_form1_file, field_data_field_form1_image, field_data_field_form1_progress, field_data_field_form1_results_public, field_data_field_form1_results_access, field_data_field_form1_results_access, field_data_field_form1_template, field_data_field_form1_template_desc, field_revision_field_form1_image, field_revision_field_form1_expiration, field_revision_field_form1_file, field_revision_field_form1_progress, field_revision_field_form1_results_access, field_revision_field_form1_results_public, field_revision_field_form1_template_desc,
|
|
|
field_revision_field_form1_template, field_revision_field_form1_template;
|
|
|
field_revision_field_form1_template, field_revision_field_form1_template,
|
|
|
framaforms_expired;
|
|
|
|
|
|
DELETE FROM node_revision
|
|
|
WHERE node_revision.nid in
|
... | ... | @@ -39,7 +40,7 @@ DELETE FROM url_alias WHERE url_alias.source LIKE 'user/%'; |
|
|
DELETE FROM node WHERE type='form1';
|
|
|
|
|
|
-- sql to empty some DB tables
|
|
|
TRUNCATE "batch", "cache", "cache_admin_menu", "cache_block", "cache_bootstrap", "cache_field", "cache_filter", "cache_form", "cache_image", "cache_libraries", "cache_menu", "cache_page", "cache_panels", "cache_path", "cache_rules", "cache_token", "cache_update", "cache_views", "cache_views_data", "flood", "history", "pgbar_webform_submissions_static", "search_dataset", "search_index", "search_total", "sessions", "themekey_ui_node_theme", "watchdog", "webform", "webform_component", "webform_conditional", "webform_conditional_actions", "webform_conditional_rules", "webform_confirm_email", "webform_confirm_email_code", "webform_confirm_email_confirmation_emails", "webform_confirmation", "webform_emails", "webform_last_download", "webform_report", "webform_roles", "webform_submissions", "webform_submitted_data", "webform_validation_rule", "webform_validation_rule_components";
|
|
|
TRUNCATE "batch", "cache", "cache_admin_menu", "cache_block", "cache_bootstrap", "cache_field", "cache_filter", "cache_form", "cache_image", "cache_libraries", "cache_menu", "cache_page", "cache_panels", "cache_path", "cache_rules", "cache_token", "cache_update", "cache_views", "cache_views_data", "flood", "history", "pgbar_webform_submissions_static", "search_dataset", "search_index", "search_total", "sessions", "themekey_ui_node_theme", "watchdog", "webform", "webform_component", "webform_conditional", "webform_conditional_actions", "webform_conditional_rules", "webform_confirm_email", "webform_confirm_email_code", "webform_confirm_email_confirmation_emails", "webform_confirmation", "webform_emails", "webform_last_download", "webform_report", "webform_roles", "webform_submissions", "webform_submitted_data", "webform_validation_rule", "webform_validation_rule_components", "webform_confirm_email_queued_emails";
|
|
|
|
|
|
-- truncate other tables
|
|
|
TRUNCATE "node_comment_statistics", "file_usage", "file_managed";
|
... | ... | @@ -70,8 +71,6 @@ UPDATE "users" SET |
|
|
"init" = 'you@yourdomain.net'
|
|
|
WHERE "name" = 'admin';
|
|
|
|
|
|
-- export DB
|
|
|
pg_dump --clean --if-exists betaforms > /tmp/betaforms_20170728.sql
|
|
|
```
|
|
|
|
|
|
## export cleaned database
|
... | ... | |