The easiest way to do this is by using copy&replace in the SQL file. Export the database. Use your favorite text editor and do a copy&replace and import it into a new database.
Then you go to wp-config.php and you change the WP_HOME and WP_SITEURL to the new host. Then you change the databasename. You also need to ensure that the same db user has access to the database.
Btw: There is a separate stackexchange for wordpress. Check out How do I move a WordPress site to another server?
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 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
- 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
- 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
- Change WordPress URL in sql file via Terminal
- Strange characters added to the database
- 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]
- What is this JavaScript “require”?
- get_results using wpdb
- wpdb->insert multiple record at once
- How to monitor server for error establishing a database connection
- Default WordPress settings API data sanitization
- Fatal error: Call to undefined function dbDelta()
- Connect to remote database using Localhost install
- remove missing image attachments
- How to ensure data consistency in WordPress
- How to intercept update_option() before it saves data?
- wpdb query on custom table not working [closed]
- How to diagnose and keep in check encoding issues?
- wp_redirection_404 table has grown to 7GB
- Delete all post meta except featured image Using SQL
- How to interact with another wordpress install on same database?
- Saving into post_excerpt or post_content
- Maintain user profile data in a non-WordPress database
- Setup private content for specific users with daily updates [closed]
- Connection refused on locahost after importing database?
- creating new field on mysql
- Does WordPress store the username as a primary key in the database?
- WSOD 3.9.1 – Tried Everything so far
- SQL query to set posts in bulk based on the post content
- Automate WordPress website setup with prefilled data
- How do you render posts from outside wordpress?
- Fetch a single row from a custom table for to a given ID
- Database create or redirect
- Database structure cheatsheet
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- A WP dev site that displays content from a live site’s database but cannot write to wp_posts?
- error establishing database connection (WAMP + filezilla)
- Is there a way for two deferent themes to consume two different DB on a same WP instance?
- Auto populate form fields based on serial input or pull listings from other websites?
- How to extract some part of WordPress full source code
- Error establishing a database connection for some files
- Hash user emails in database?
- Weird characters in title if it contain “ ”
- Saving data to database and exporting to excel
- One information repeated on multiple locations on one site [closed]
- Showing Error(TAble already exist)
- wp-config was suddenly updated
- Order of search results based off of a backend custom field and also in alpha order
- How to find fresh (last modified) and sql backup?