Zen Cart Logo
Forums / Installing on a Linux/Unix Server / Remove prefixes from tables

Remove prefixes from tables

Locked

Views: 2,944

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
30 Sep 2008, 3:49 AM
#1
debra_in_mo avatar

debra_in_mo

New Zenner

Join Date:
Apr 2007
Posts:
23
Plugin Contributions:
0

Remove prefixes from tables

How does one remove the prefixes from the tables in a MYSQL database? I have phpMyAdmin if that makes a difference.

All of mine have the prefix "zen_". When doing an upgrade of the database, I deleted this prefix in the box asking me what I'd like to change the prefix to, but the upgrade left it the same.

30 Sep 2008, 7:11 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Remove prefixes from tables

Very carefully - - always make a backup to revert back to first....

30 Sep 2008, 7:26 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Remove prefixes from tables

It won't do the rename if your configure.php files aren't writable.

30 Sep 2008, 3:50 PM
#4
debra_in_mo avatar

debra_in_mo

New Zenner

Join Date:
Apr 2007
Posts:
23
Plugin Contributions:
0

Re: Remove prefixes from tables

Thanks. When I do the final upgrade & reinstall, I'll remember to change the permissions for that step. Right now I'm just testing and trying to learn my way around everything. I have several copies of everything and appreciate all the cautions to backup-backup-backup. :)

I found directions for renaming the tables within PHPMyAdmin: https://support.lunarpages.com/knowledge_bases/article/289 which solves my current problem in working with this particular database. Guess I have to do this one by one.

30 Sep 2008, 6:10 PM
#5
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Re: Remove prefixes from tables

Hi Debra,
today I spent a really stupid amount of time cutting and pasting between various programs to get the complete table list out of phpmyadmin and into the text sql format below which I used to change the table prefixes on a couple of databases.
If you do a find-and-replace to change these prefixes to the ones you want and then paste it into the SQL query for the database in phpmyadmin it will do all the tables at once. It does give an error at the end, don't know why, but it does work.
Regards
Steve
ps this is the table list (95) for a standard install, you may have other tables from contributions.

RENAME TABLE zen_address_book to zen138a_address_book,
zen_address_format to zen138a_address_format,
zen_admin to zen138a_admin,
zen_admin_activity_log to zen138a_admin_activity_log,
zen_authorizenet to zen138a_authorizenet,
zen_banners to zen138a_banners,
zen_banners_history to zen138a_banners_history,
zen_categories to zen138a_categories,
zen_categories_description to zen138a_categories_description,
zen_configuration to zen138a_configuration,
zen_configuration_group to zen138a_configuration_group,
zen_counter to zen138a_counter,
zen_counter_history to zen138a_counter_history,
zen_countries to zen138a_countries,
zen_coupons to zen138a_coupons,
zen_coupons_description to zen138a_coupons_description,
zen_coupon_email_track to zen138a_coupon_email_track,
zen_coupon_gv_customer to zen138a_coupon_gv_customer,
zen_coupon_gv_queue to zen138a_coupon_gv_queue,
zen_coupon_redeem_track to zen138a_coupon_redeem_track,
zen_coupon_restrict to zen138a_coupon_restrict,
zen_currencies to zen138a_currencies,
zen_customers to zen138a_customers,
zen_customers_basket to zen138a_customers_basket,
zen_customers_basket_attributes to zen138a_customers_basket_attributes,
zen_customers_info to zen138a_customers_info,
zen_customers_wishlist to zen138a_customers_wishlist,
zen_db_cache to zen138a_db_cache,
zen_email_archive to zen138a_email_archive,
zen_ezpages to zen138a_ezpages,
zen_featured to zen138a_featured,
zen_files_uploaded to zen138a_files_uploaded,
zen_geo_zones to zen138a_geo_zones,
zen_get_terms_to_filter to zen138a_get_terms_to_filter,
zen_group_pricing to zen138a_group_pricing,
zen_languages to zen138a_languages,
zen_layout_boxes to zen138a_layout_boxes,
zen_manufacturers to zen138a_manufacturers,
zen_manufacturers_info to zen138a_manufacturers_info,
zen_media_clips to zen138a_media_clips,
zen_media_manager to zen138a_media_manager,
zen_media_to_products to zen138a_media_to_products,
zen_media_types to zen138a_media_types,
zen_meta_tags_categories_description to zen138a_meta_tags_categories_description,
zen_meta_tags_products_description to zen138a_meta_tags_products_description,
zen_music_genre to zen138a_music_genre,
zen_newsletters to zen138a_newsletters,
zen_nochex_apc_transactions to zen138a_nochex_apc_transactions,
zen_nochex_sessions to zen138a_nochex_sessions,
zen_orders to zen138a_orders,
zen_orders_products to zen138a_orders_products,
zen_orders_products_attributes to zen138a_orders_products_attributes,
zen_orders_products_download to zen138a_orders_products_download,
zen_orders_status to zen138a_orders_status,
zen_orders_status_history to zen138a_orders_status_history,
zen_orders_total to zen138a_orders_total,
zen_paypal to zen138a_paypal,
zen_paypal_payment_status to zen138a_paypal_payment_status,
zen_paypal_payment_status_history to zen138a_paypal_payment_status_history,
zen_paypal_session to zen138a_paypal_session,
zen_paypal_testing to zen138a_paypal_testing,
zen_products to zen138a_products,
zen_products_attributes to zen138a_products_attributes,
zen_products_attributes_download to zen138a_products_attributes_download,
zen_products_description to zen138a_products_description,
zen_products_discount_quantity to zen138a_products_discount_quantity,
zen_products_notifications to zen138a_products_notifications,
zen_products_options to zen138a_products_options,
zen_products_options_types to zen138a_products_options_types,
zen_products_options_values to zen138a_products_options_values,
zen_products_options_values_to_products_options to zen138a_products_options_values_to_products_options,
zen_products_to_categories to zen138a_products_to_categories,
zen_product_music_extra to zen138a_product_music_extra,
zen_product_types to zen138a_product_types,
zen_product_types_to_category to zen138a_product_types_to_category,
zen_product_type_layout to zen138a_product_type_layout,
zen_project_version to zen138a_project_version,
zen_project_version_history to zen138a_project_version_history,
zen_query_builder to zen138a_query_builder,
zen_record_artists to zen138a_record_artists,
zen_record_artists_info to zen138a_record_artists_info,
zen_record_company to zen138a_record_company,
zen_record_company_info to zen138a_record_company_info,
zen_reviews to zen138a_reviews,
zen_reviews_description to zen138a_reviews_description,
zen_salemaker_sales to zen138a_salemaker_sales,
zen_sessions to zen138a_sessions,
zen_specials to zen138a_specials,
zen_tax_class to zen138a_tax_class,
zen_tax_rates to zen138a_tax_rates,
zen_template_select to zen138a_template_select,
zen_upgrade_exceptions to zen138a_upgrade_exceptions,
zen_whos_online to zen138a_whos_online,
zen_zones to zen138a_zones,
zen_zones_to_geo_zones to zen138a_zones_to_geo_zones;
30 Sep 2008, 6:41 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Remove prefixes from tables

Using zc_install to do the rename takes only a couple minutes. There's no need to be doing an actual version-upgrade to just do a rename.

1 Oct 2008, 4:35 AM
#7
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Re: Remove prefixes from tables

Hi,
I dont understand about zc_install renaming tables.
I thought it just created the necessary tables in the specified database. How does it rename what is already there?
thanks
Steve

Edit: B****cks: the info is here: http://www.zen-cart.com/forum/showthread.php?t=50108