|
|
# clean DB for creating an init DB
|
|
|
|
|
|
```sql
|
|
|
# clean all forms nodes (takes ~1mn for 1000 nodes)
|
|
|
drush genc --kill --types=form1 0 0
|
|
|
|
|
|
#sql to empty DB
|
|
|
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";
|
|
|
|
|
|
#query to delete all users except admin
|
|
|
delete from users where uid != 0 and uid != 1;
|
|
|
|
|
|
#set "changemeASAP!" as the admin password
|
|
|
UPDATE "users" SET
|
|
|
"uid" = '1',
|
|
|
"name" = 'admin',
|
|
|
"pass" = '$S$DJe7RyQRrq4GiL7xQgAJ1mgQQb1MMPEIMxfNZfrvd2uKTJ8GL9VD',
|
|
|
"mail" = 'you@yourdomain.com',
|
|
|
"theme" = '',
|
|
|
"signature" = '',
|
|
|
"signature_format" = 'wysiwyg_user',
|
|
|
"created" = '1435832726',
|
|
|
"access" = '1501253486',
|
|
|
"login" = '1501253486',
|
|
|
"status" = '1',
|
|
|
"timezone" = 'Europe/Paris',
|
|
|
"language" = 'fr',
|
|
|
"picture" = '0',
|
|
|
"init" = 'you@yourdomain.net'
|
|
|
WHERE "name" = 'admin';
|
|
|
|
|
|
#export DB
|
|
|
pg_dump --clean --if-exists betaforms > /tmp/betaforms_20170728.sql
|
|
|
``` |
|
|
\ No newline at end of file |