This question has been discussed several times on the WordPress Hackers email list, I’d recommend Googling something like wp-hackers absolute relative
to get an overview of the various lively debates that have taken place over the years.
Personally I use the searchreplacedb2 script whenever I migrate a database between URLs, e.g. from live to local/test/dev.
Related Posts:
- How to move existing WordPress wp-content folder along with database to new server and new domain name?
- What is the purpose of storing `siteurl` in database?
- I don’t see site_url and home_url fields in wp_options table (phpMyAdmin)?
- Moving Site: Is Re-downloading Files After Changing URLs necessary?
- Sub-domain or 2nd, temporary different domain?
- How to retrieve TLD domain for the current website?
- Redirecting to old domain after migration website
- WSOD 3.9.1 – Tried Everything so far
- Is it risky if I update all url in the database due to my site url changed?
- echo site_url() returns a different value than what is in the database siteurl field
- Do I need to be selective about where I search and replace when pointing a domain to a subfolder used for development?
- WordPress URL error for links
- After Migration From dev, Only my Links to the Homepage Still Redirect to dev
- Change Domain name in database
- Changing the site URL
- WordPress site seems convinced that it’s still at its old URL
- What is the difference between an ORM and an ODM?
- Rename a table in MySQL
- How should I tackle –secure-file-priv in MySQL?
- Keeping WP database synced across multiple developers using git
- Checking if Database Table exists
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- Is it possible to define two databases for one installation?
- Connect forms in WP to external database
- Hook into $wpdb
- Syncing local content with development / staging sites
- Export WP database for import using WP-CLI on Vagrant Box
- Is it wise to delete post revisions and autosaves from database?
- Improve or optimize a very slow query
- What is the advantage of separating wp_users and wp_usermeta table?
- “MySQL server has gone away” since update to 3.8
- WordPress page title repeated in SOME pages
- Using two different DB users on one WP install
- Usage of Direct Database Call Without Caching Error
- Is $wpdb->prepare escaping to much? How to use it properly?
- wp_options table has duplicate rows and primary key / autoincrement has been removed
- How to log database changes during an upgrade?
- Automate dir and DB stack creation with WP-CLI
- Moving WP from local server to live, error establishing a db connection
- Is there a way to see history of WordPress database changes?
- WordPress and MySQL: how to transfer Meta_key and Meta_Value from one post_id to another
- Where does the actual data stored by add_post_meta
- Exporting table to csv works in the admin but exports HTML data when used on the front end
- wp search-replace (not executing)
- How to have an external DB read and get data from my wordpress database
- Import users from old WP site to new one
- Create table from array with prepare
- Migrate database between 2 different wordpress version
- SSO system between 2 WordPress installs on different servers
- Form that sends data to an admin panel and can export it
- is $wpdb->get_results() safe enough
- Convert user passwords to MD5?
- is wordpress stores Role Id in WP database?
- Does post_meta data need to be unserialzed?
- Can’t update WordFence Options, clear data manually
- How to backup my site and restore my wordpress site
- Is it possible to have more than 1 MySQL database in my WordPress blog?
- How to fetch records from database WordPress
- AJAX wp-mysql running too slow
- Delete/Replace words from X to Y in post content
- How get Data form wordpress database as array not stdclass?
- cannot connect database
- Location of image metadata on my server
- How to create more than one new wpdb object?
- Multiple WordPress sites installs sharing the same database but with different content and domains
- Brandoo WordPress Unable to Update to WordPress 4.2.2
- Remote database -> massive response time increase?
- Custom Post Type not showing anything added by code anymore?
- Database tables for sports betting integrated in WordPress
- How do I have a user upload a blog post and then retrieve that to display in a card on the site?
- Delete user with only subscriber role
- How to rename custom table name programatically in wordpress?
- How to edit custom table data in frontend
- pre_get_posts causings DB error when using ( ‘posts_per_page’, -1)?
- generate PDF from member information
- Unable to login to a https website via the app after changing from http
- mysqli_query(): MySQL server has gone away for Curl Request
- Help posting values to DB on submit using $wpdb->query
- WP website showing blank page after moving from subdomain to main domain
- create a table using user meta custom data
- wpdb query to insert images in to post/page gallery
- Creating a database in my plugin not working
- How to create index (sql) to a meta_key?
- WPCLI search and replace in a particlar site dir effect another site-dir
- How to create a database table?
- get_user_meta and umeta_id
- $wpdb not working
- Database error after importing WordPress
- Send data to database after redirect (and popping out of iframe)
- Simple email input store in database
- Pulling values from a sepcific row in table
- import (migration) user database to wp-users
- Create hundreds of users with just ID in phpMyAdmin
- What is best for saving lot of extra detail of user?
- Insert Extra fields added in the front end registration form to DB
- $wpdb->insert not working for last select option
- How to create a table [closed]
- Upload wordpress from localhost to 000webhost
- WP Multisite Users Not Linking
- Query a meta key using an array of values where the database value is a string