Showing posts with label drupal. Show all posts
Showing posts with label drupal. Show all posts
Saturday, October 8, 2016
Convert MyISAM to InnoDB Drupal
Convert MyISAM to InnoDB Drupal
Convert Drupal MySQL engine from MyISAM to InnoDB using Drush:
drush updatedb -y && drush sql-query "SELECT ENGINE AS Engine Before: FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=node;" && ($(drush sql-connect | sed -e s/^mysql/mysqldump --no-data/ | sed -e s/--database=/--databases /) | sed s/ENGINE=MyISAM/ENGINE=InnoDB/ | sed s/varchar(256)/varchar(255)/ > ~/schema.sql) && drush sql-dump -q --data-only --result-file=~/data.sql && drush sql-dump -y --result-file=~/backup.sql && drush sql-drop -y && ($(drush sql-connect) < ~/schema.sql) && ($(drush sql-connect) < ~/data.sql) && rm ~/schema.sql && rm ~/data.sql && drush sql-query "SELECT ENGINE AS Engine After: FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=node;" && drush cc all && echo "Remember to delete ~/backup.sql after verifying the site still works."
Credits:
- http://stackoverflow.com/a/23393131
- http://stackoverflow.com/a/16820166
P.S. This is safer and faster and causes much less strain on your database server than a lot of ALTER statements on the live database (especially for cluster solutions, like Percona)
Go to link download
Sunday, August 21, 2016
How to create a Drupal 7 newsletter with HTML email formatting
How to create a Drupal 7 newsletter with HTML email formatting
Enable Simplenews (and dependencies):
drush en -y simplenews mimemail mailsystem htmlmail
drush updatedb
Configure Simplenews to use HTML format and default send action is to "Send newsletter":
/admin/config/services/simplenews/settings
Configure your custom newsletter content type to use HTML format:
/admin/config/services/simplenews/categories/
Give "Subscribe to newsletters" and "Choose to receive plaintext emails via HTML Mail" permissions to all roles and give the remaining Simplenews permissions to Content Administrators (or other desired role):
/admin/people/permissions
Additional secret-decoder-ring configuration:
https://www.drupal.org/node/1283756#comment-5733262
Add newsletter subscribe block to desired theme section:
/admin/structure/block
Logout of site and subscribe via block from previous step. P.S. You can also auto-populate subscribers here:
/admin/people/simplenews
Login to site and create newsletter:
/node/add/simplenews
Send newsletter to queue (by clicking the "Newsletter" tab of the newly created node):
/node/
Run cron to process the queue (may need to run multiple times if number of recipients is greater than "cron throttle" setting on /admin/config/services/simplenews/settings/mail):
/admin/reports/status/run-cron
P.S. Its better to use real cron instead of Drupals default poormanscron.
Go to link download
Subscribe to:
Posts (Atom)