wordpress - Issue in Updating the IP in DB -


we encountered below listed issue while migrating our company site new site following steps below:

  1. we have launched new amazon rds instance , imported data old db new rds.
  2. we pointed website newly launched rds
  3. assigned new elastic ip address wordpress site , ip of instance got change.
  4. ran query update new ip in database level

but after executing query prod site still pointed old ip.

fix:

  1. we have taken db dump in .sql format , analysed. found old url still hard coded in db
  2. so have edited .sql dump replacing old url new url. , imported edited dump db. after import , restarting, application started working fine.

could please let me know (1) whether such hard coding ip common practice in wp , (2) there better way avoid hard coding?

thanks in advance!

wordpress not store server ip address in database, does store full url site in many places.

it sounds must using ip address access website, meaning people visit site going http://xxx.xxx.xxx.xxx , not http://www.example.com, explain why ip address being stored in database.

when migrating new domain name, have search , replace database instances of old domain new domain. preferable use tool wp-cli search-replace task because account serialized array data can become corrupted if simple find , replace in text editor. tool allow skip columns, 'guid' column, might want keep when migrating domains.

currently, there no "better way" avoid hard-coding site url in database since default wordpress behavior. you can read more in wordpress handbook here, explains why absolute urls stored in database.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -