You should not use this technique to change the URL of your site : WordPress sometimes stores URLs in serialized strings. You find/replace will corrupt the serialized data and discard the whole content.
You can use interconnect/it search and replace tool to change the domain without any risk. This tool even allow you to run a dry test to check what will be modified.
If you prefer the sed
technique, you should escape all special characters that have special meanings in regex like dots :
sed 's|http://www\.domain\.com|http://www\.newdomain\.com|g' mydatabase.sql
Related Posts:
- Multiple developers / editors working on a site in progress
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- Fastest way (least amount of steps) to locally import a remote database using WP-CLI
- Solution for database version control and deployment?
- How to migrate a HTTPS WordPress installation to localhost?
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- How can I migrate from another platform to WordPress (using the same domain) and launch when ready?
- Migrating data between local and development server
- Best way to import users, post and categories from an external database
- Syncing local content with development / staging sites
- Organizing WP Pages based on old website database
- Presentation vs Content in WP DB-Tables
- Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
- Migrate a Non WordPress database to wordpress [closed]
- Weird issue with database migration and SSL links
- How to fix unchanged URLs in Database after running serialized search and replace script?
- Migrating database / content of non-CMS site to WordPress
- How do I reset a self-hosted WordPress URL?
- I don’t see site_url and home_url fields in wp_options table (phpMyAdmin)?
- Export all content from wordpress
- Migrating WordPress from DreamHost to Azure WordPress Resource via UpdraftPlus “wp_options table does not exist…” error
- Moving minor updates between local and live sites – just database?
- How to move the WordPress site Layout from test site to Production site?
- Merging two databases without borking it
- wp search-replace (not executing)
- Why does importing copies of the database dump and the document root make WordPress data inconsistent?
- Able to use all admin pages but in the frontend there is a “Error establishing a database connection”-Error
- Trouble Migrating all data blog from WordPress.com to WordPress.org
- Copying database tables to new database
- Migrating from PDO using SQLite to clean new install using MySQL
- Migration: Copying database content to a different server
- Strange characters added to the database
- Database Update Required – Update from command-line
- After database migration, theme mods don’t show [closed]
- Problem migrating to localhost
- WordPress url transformation script
- How to transfer from localHost to live but use the already existing database on the server?
- Image link issues after importing a database backup to my local web server
- Database migration issues – Error #1046 No database selected
- echo site_url() returns a different value than what is in the database siteurl field
- Migrate Users From laravel to wordpress
- /wp-admin not accessible after migrating to local host (no plugin issue)
- How to fix Uploaded to this post option to see group of images uploaded to a post?
- How do you enable scripts on a WordPress installation in Softaculous?
- WordPress site migration – locked out of admin area
- Malware in old website – how to migrate?
- WP website showing blank page after moving from subdomain to main domain
- WordPress Migration – Issue with admin panel changes
- Do I need to be selective about where I search and replace when pointing a domain to a subfolder used for development?
- How to edit posts/pages without making the change live?
- Migrate not successful, DB is broken. How to fix, or at least output static HTML without plugins?
- After Migration From dev, Only my Links to the Homepage Still Redirect to dev
- I cannot change anything in my wordpress database from within wordpress?
- Media library images “missing” after migrating them using SQL
- Restoring .sql backup results in “Error establishing a database connection”
- import (migration) user database to wp-users
- Database question while Migrating from one domain to another on same WebHost [Bluehost]
- Moving database from WP 2.6 to 3.5 problem
- Importing Concrete5 content to WordPress
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]
- phpMyAdmin – Error > Incorrect format parameter?
- Why is my database import losing text widget data?
- how can get database name in wordpress?
- Moving WordPress to new server: no posts found
- Long option names fail silently?
- Migrating WPMS from apache to IIS7 causes Database Error
- Upload files – total size limit – WordPress/Contact Form 7
- After moving my site from a dev subdomain, to root, all my custom meta data is gone
- Relationship between performance and database size
- WordPress and automated MySQL backups to a different host
- Size article thumbnails and retrieve them directly from database
- Should I be able to run two different “close” code versions of wordpress with the same DB
- how to store arrays into a database
- Where are WP_Errors Saved
- Error establishing database connection – high traffic?
- Is there a solution to auto-post data to a WP post from a database
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- Uknown meta entries in wp_postmeta
- Insert Query not working in the form
- Enter user registration information in the database
- Importer fails to import every post
- Unkown meta_value in ACF
- Buddypress avatar image in database [closed]
- WordPress security [closed]
- WordPress SQL – How to Check for Category?
- Advantages of dbDelta
- Only allow user to access a link once a year, based on their joining date
- Help with $wpdb on custom code
- “BS_” rows in postmeta table
- A query to substitute images paths in gutenberg (website migration)?
- I Want a More Concice Form of Data than an Array
- Duplicate database to roll back theme & content changes
- mySQL database size large, but tables size less
- Error establishing database connection error during first WordPress run
- Can’t Install WordPress (local) Failed to open file wp-includes/wp-db.php
- version control for wordpress? (wordpress folder and database at same time)
- Install WordPress with SQL database
- Creating Job Tickets
- Best db table structure for users with many records
- Is it possible to have a form page for logged-out users where values are stored persistently?