SEO Test

October 21, 2007

Add prefix to Drupal’s MySQL tables.

Filed under: code — Crevete @ 5:19 pm

You want to rename your Drupal tables by adding a prefix to them? There are about 57 tables in my MySQL database . Here’s the SQL code that will save you a couple of minutes. To add your own prefix just open up a text editor and use Find and Replace from drupal_ to your_prefix_. Because of additional modules, more tables may exist in your drupal database, just add those manually.

RENAME TABLE access TO drupal_access,
aggregator_category TO drupal_aggregator_category,
aggregator_category_feed TO drupal_aggregator_category_feed,
aggregator_category_item TO drupal_aggregator_category_item,
aggregator_feed TO drupal_aggregator_feed,
aggregator_item TO drupal_aggregator_item,
authmap TO drupal_authmap,
blocks TO drupal_blocks,
blocks_roles TO drupal_blocks_roles,
boxes TO drupal_boxes,
cache TO drupal_cache,
cache_filter TO drupal_cache_filter ,
cache_menu TO drupal_cache_menu ,
cache_page TO drupal_cache_page ,
category TO drupal_category ,
category_cont TO drupal_category_cont ,
category_cont_distant TO drupal_category_cont_distant ,
category_cont_node_types TO drupal_category_cont_node_types ,
category_display TO drupal_category_display ,
category_hierarchy TO drupal_category_hierarchy ,
category_node TO drupal_category_node ,
category_relation TO drupal_category_relation ,
category_synonym TO drupal_category_synonym ,
comments TO drupal_comments ,
files TO drupal_files ,
file_revisions TO drupal_file_revisions ,
filters TO drupal_filters ,
filter_formats TO drupal_filter_formats ,
flood TO drupal_flood ,
history TO drupal_history ,
menu TO drupal_menu ,
node TO drupal_node ,
nodewords TO drupal_nodewords ,
node_access TO drupal_node_access ,
node_comment_statistics TO drupal_node_comment_statistics ,
node_counter TO drupal_node_counter ,
node_revisions TO drupal_node_revisions ,
node_type TO drupal_node_type ,
permission TO drupal_permission ,
role TO drupal_role ,
sequences TO drupal_sequences ,
sessions TO drupal_sessions ,
system TO drupal_system ,
term_data TO drupal_term_data ,
term_hierarchy TO drupal_term_hierarchy ,
term_node TO drupal_term_node ,
term_relation TO drupal_term_relation ,
term_synonym TO drupal_term_synonym ,
tinymce_role TO drupal_tinymce_role ,
tinymce_settings TO drupal_tinymce_settings ,
url_alias TO drupal_url_alias ,
users TO drupal_users ,
users_roles TO drupal_users_roles ,
variable TO drupal_variable ,
vocabulary TO drupal_vocabulary ,
vocabulary_node_types TO drupal_vocabulary_node_types ,
watchdog TO drupal_watchdog ;

2 Comments »

  1. you rock! thanks.

    Comment by xtfer — November 26, 2007 @ 8:13 pm

  2. updated it a bit (of course filled with custom modules):

    RENAME TABLE drupalaccess TO drupal_access,
    drupalaccesslog TO drupal_accesslog,
    drupalactions TO drupal_actions,
    drupalactions_aid TO drupal_actions_aid,
    drupalauthmap TO drupal_authmap,
    drupalbatch TO drupal_batch,
    drupalblocks TO drupal_blocks,
    drupalblocks_roles TO drupal_blocks_roles,
    drupalboxes TO drupal_boxes,
    drupalcache TO drupal_cache,
    drupalcache_block TO drupal_cache_block ,
    drupalcache_content TO drupal_cache_content ,
    drupalcache_filter TO drupal_cache_filter ,
    drupalcache_form TO drupal_cache_form ,
    drupalcache_menu TO drupal_cache_menu ,
    drupalcache_page TO drupal_cache_page ,
    drupalcache_rules TO drupal_cache_rules ,
    drupalcache_uc_price TO drupal_cache_uc_price ,
    drupalcache_update TO drupal_cache_update ,
    drupalcache_views TO drupal_cache_views ,
    drupalcache_views_data TO drupal_cache_views_data ,
    drupalca_predicates TO drupal_ca_predicates ,
    drupalcomments TO drupal_comments ,
    drupalconditional_fields TO drupal_conditional_fields ,
    drupalcontent_access TO drupal_content_access ,
    drupalcontent_group TO drupal_content_group ,
    drupalcontent_group_fields TO drupal_content_group_fields ,
    drupalcontent_node_field TO drupal_content_node_field ,
    drupalcontent_node_field_instance TO drupal_content_node_field_instance ,
    drupalcontent_type_profile TO drupal_content_type_profile ,
    drupaldate_formats TO drupal_date_formats ,
    drupaldate_format_locale TO drupal_date_format_locale ,
    drupaldate_format_types TO drupal_date_format_types ,
    drupaldevel_queries TO drupal_devel_queries ,
    drupaldevel_times TO drupal_devel_times ,
    drupalfaq_questions TO drupal_faq_questions ,
    drupalfaq_weights TO drupal_faq_weights ,
    drupalfckeditor_role TO drupal_fckeditor_role ,
    drupalfckeditor_settings TO drupal_fckeditor_settings ,
    drupalfiles TO drupal_files ,
    drupalfilters TO drupal_filters ,
    drupalfilter_formats TO drupal_filter_formats ,
    drupalflood TO drupal_flood ,
    drupalforum TO drupal_forum ,
    drupalhistory TO drupal_history ,
    drupalmenu_custom TO drupal_menu_custom ,
    drupalmenu_links TO drupal_menu_links ,
    drupalmenu_router TO drupal_menu_router ,
    drupalnode TO drupal_node ,
    drupalnodeaccess TO drupal_nodeaccess ,
    drupalnodeaccess_role_alias TO drupal_nodeaccess_role_alias ,
    drupalnode_access TO drupal_node_access ,
    drupalnode_comment_statistics TO drupal_node_comment_statistics ,
    drupalnode_counter TO drupal_node_counter ,
    drupalnode_revisions TO drupal_node_revisions ,
    drupalnode_type TO drupal_node_type ,
    drupalpermission TO drupal_permission ,
    drupalrole TO drupal_role ,
    drupalrules_rules TO drupal_rules_rules ,
    drupalrules_sets TO drupal_rules_sets ,
    drupalsearch_dataset TO drupal_search_dataset ,
    drupalsearch_index TO drupal_search_index ,
    drupalsearch_node_links TO drupal_search_node_links ,
    drupalsearch_total TO drupal_search_total ,
    drupalsessions TO drupal_sessions ,
    drupalsimplenews_mail_spool TO drupal_simplenews_mail_spool,
    drupalsimplenews_newsletters TO drupal_simplenews_newsletters,
    drupalsimplenews_snid_tid TO drupal_simplenews_snid_tid,
    drupalsimplenews_subscriptions TO drupal_simplenews_subscriptions,
    drupalsystem TO drupal_system ,
    drupalterm_data TO drupal_term_data ,
    drupalterm_hierarchy TO drupal_term_hierarchy ,
    drupalterm_node TO drupal_term_node ,
    drupalterm_relation TO drupal_term_relation ,
    drupalterm_synonym TO drupal_term_synonym ,

    drupaluc_cart_link_clicks TO drupal_uc_cart_link_clicks,
    drupaluc_cart_products TO drupal_uc_cart_products,
    drupaluc_countries TO drupal_uc_countries,
    drupaluc_ideal_pro_payment TO drupal_uc_ideal_pro_payment,
    drupaluc_orders TO drupal_uc_orders,
    drupaluc_order_admin_comments TO drupal_uc_order_admin_comments,
    drupaluc_order_comments TO drupal_uc_order_comments,
    drupaluc_order_line_items TO drupal_uc_order_line_items,
    drupaluc_order_log TO drupal_uc_order_log,
    drupaluc_order_products TO drupal_uc_order_products,
    drupaluc_order_statuses TO drupal_uc_order_statuses,
    drupaluc_payment_check TO drupal_uc_payment_check,
    drupaluc_payment_cod TO drupal_uc_payment_cod,
    drupaluc_payment_other TO drupal_uc_payment_other,
    drupaluc_payment_paypal_ipn TO drupal_uc_payment_paypal_ipn,
    drupaluc_payment_receipts TO drupal_uc_payment_receipts,
    drupaluc_products TO drupal_uc_products,
    drupaluc_product_classes TO drupal_uc_product_classes,
    drupaluc_product_features TO drupal_uc_product_features,
    drupaluc_product_max TO drupal_uc_product_max,
    drupaluc_roles_expirations TO drupal_uc_roles_expirations,
    drupaluc_roles_products TO drupal_uc_roles_products,
    drupaluc_store_footers TO drupal_uc_store_footers,
    drupaluc_zones TO drupal_uc_zones,

    drupalurl_alias TO drupal_url_alias ,
    drupalusers TO drupal_users ,
    drupalusers_roles TO drupal_users_roles ,
    drupalvariable TO drupal_variable ,
    drupalviews_display TO drupal_views_display,
    drupalviews_object_cache TO drupal_views_object_cache,
    drupalviews_view TO drupal_views_view,
    drupalvocabulary TO drupal_vocabulary ,
    drupalvocabulary_node_types TO drupal_vocabulary_node_types ,
    drupalwatchdog TO drupal_watchdog ;

    Comment by elbow — October 14, 2010 @ 3:14 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress