mysql - Why does changing Database Table Prefixes result in loss of content?

As to add an additional layer of security, to an eCommerce website I am working on, I have changed the default Database

As to add an additional layer of security, to an eCommerce website I am working on, I have changed the default Database prefix from wp_ to wp_additional_prefix.

To do this, I opened the wp-config.php file and modified the $table_prefix = 'wp_'; entry to $table_prefix = 'wp_additional_prefix';

To modify existing Database Tables, I ran the following SQL Query for each Database Table:

RENAME table `wp_table_name` TO `wp_additional_prefix_table_name`;

I then searched the Fields, within the wp_options and wp_usermeta Tables, and replaced all references of wp_ with wp_additional_prefix.

Whilst I was able to successfully perform the above actions, it did result in some of the website's content going missing. Content such as the website's Logo and Sliders. Additionally, each page's layout changes.

As such, I am wondering where I could be going wrong. Could it be that I am missing a Field or simply deviating from the default Database Prefix breaks the website?

As to add an additional layer of security, to an eCommerce website I am working on, I have changed the default Database prefix from wp_ to wp_additional_prefix.

To do this, I opened the wp-config.php file and modified the $table_prefix = 'wp_'; entry to $table_prefix = 'wp_additional_prefix';

To modify existing Database Tables, I ran the following SQL Query for each Database Table:

RENAME table `wp_table_name` TO `wp_additional_prefix_table_name`;

I then searched the Fields, within the wp_options and wp_usermeta Tables, and replaced all references of wp_ with wp_additional_prefix.

Whilst I was able to successfully perform the above actions, it did result in some of the website's content going missing. Content such as the website's Logo and Sliders. Additionally, each page's layout changes.

As such, I am wondering where I could be going wrong. Could it be that I am missing a Field or simply deviating from the default Database Prefix breaks the website?

Share Improve this question asked Jul 8, 2019 at 13:42 CraigCraig 3581 gold badge2 silver badges20 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You should have not searched the field and replaced all the references to wp_ with anything. For example : the value of the entry with meta_key wp_page_for_privacy_policy will be change to wp_addtionnal_prefix page_for_privacy_policy. Hence there could be a lot of misfitted values in your table.

A better way would have been to :

  • export the DB
  • import the DB as a new DB
  • rename all tables with the new prefixes
  • export it again
  • import it in you old DB
  • rename prefix in wp_config.php
  • check if everything is allright

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745337401a4623168.html

相关推荐

  • mysql - Why does changing Database Table Prefixes result in loss of content?

    As to add an additional layer of security, to an eCommerce website I am working on, I have changed the default Database

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信