I normally use mysqldump and sed:
on old server:
mysqldump -u user -p OldWpdatabase > wpdb.sql
sed -i 's/oldurl/newurl/g' wpdb.sql
on new server:
mysql -u user -p NewWpdatabase < wpdb.sql
sed is used to search and replace all the hard coded occurrences of the website if needed.
Related Posts:
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- Export WP database for import using WP-CLI on Vagrant Box
- MySQL Syntax Error upon restoring database from backup [closed]
- Merging two databases without borking it
- Import users from old WP site to new one
- Best practice to import user base (subscribers) from one website to another?
- Importer fails to import every post
- Is it good practice to import/export a blog to test a redesign?
- I broke database after reuploading local version – what exactly happened? Database error
- export individual posts to text files or a single csv file
- What is “Advanced” SQL?
- Why is my database import losing text widget data?
- Where are image paths to product category images stored in WordPress database
- Sharing database for collaborative development
- Display data from a non wordpress database on a page template
- Best way to import users, post and categories from an external database
- What’s the database relationship between a post and its attachments
- Organizing WP Pages based on old website database
- Export wordpress table to excel
- Inserting Post Meta From SQL
- Bulk Update of Custom Post Type Post Status through SQL
- How do I add indexes to WordPress Database?
- Moving an entire wordpress site from one domain to a new domain and database
- Block search SQL from happening
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Is a direct or import approach safer for migration into WordPress?
- Is it possible to import a wordpress backup from a single site in to a multi-site configuration?
- Scheduling posts in database
- Size article thumbnails and retrieve them directly from database
- Importing New Posts from Live Site into Local Dev Site
- How much of my site can I recover from public_html?
- wpdb_prepare with multiple or condition
- Uppercase to sentence case for post titles
- Import live site to local setup without access to live site
- Error establishing a database connection; After importing DB & Theme
- WordPress and MySQL: how to transfer Meta_key and Meta_Value from one post_id to another
- WordPress database import: Row size too large
- Create a clone from one WordPress site to another in a few minutes
- How to Mirror WordPress database from Remote server to Local server
- WordPress is not creating table in database after activating plugin,
- Bulk-create posts from SQL database
- Exporting table to csv works in the admin but exports HTML data when used on the front end
- Difficulty importing my live site to local
- How can i customize the export personal data file?
- Importing CSV into database table not working?
- WordPress Database Huge wp_usermeta Table
- Create table from array with prepare
- WordPress Local And Live Site
- Insert Query not working in the form
- WPDB SQL query with prepare() returning variable, not db value
- Importing Direct to DB – GUID Question
- Problems with moving my WordPress site to another domain/server
- Export a custom Mysql database product catalog to WordPress
- Why this query is not showing any result on wordpresss home page?
- Is it possible to have more than 1 MySQL database in my WordPress blog?
- pull data from a remote wordpress database
- How to migrate a database from a server to another
- Is there an easy way of exporting posts with their category already asigned and pictures from localhost?
- Clear Terms from Taxonomy for Specific Post IDs?
- Why does changing Database Table Prefixes result in loss of content?
- Options on how to Display member specific data from a MS SQL database
- Delete/Replace words from X to Y in post content
- How to delete a particular row in a database table
- Location of WP default mySQL tables creation file?
- $wpdb->get_var – What value is returned when zero records are found?
- How to display data from db in select list [closed]
- WordPress SQL – How to Check for Category?
- Getting value from database table depending on field value
- custom tables in wordpress Database? (can i just create them with sql?)
- Accidently changed the GUID
- Deleting empty meta key values
- Bulk Edit Media Library alt, caption, image names
- Sql query to get all metadata for a post
- SQL database import #1046 error
- How do I loop/iterate through posts to edit all img tags?
- Exporting Post ID, Post Title, Primary Category and Primary Category ID
- Export only a part of the database for migration
- Featured image from custom to WordPress database
- Exporting Post type from one theme and importing it to another theme
- Help posting values to DB on submit using $wpdb->query
- What’s the easiest way to connect external database and display data on wordpress?
- How to set posts to draft in bulk based on the content of the post
- How to create index (sql) to a meta_key?
- 2 $wpdb queries causing error Table ‘wp_postmeta’ is specified twice, both as a target for ‘UPDATE’
- Delete all users meta that named: user_avatar
- Correct and secure way to access a custom SQL database in a custom PHP template file
- The MySQL Connection could not be established., before it was joomla but i have change it into worpress
- How to retrieve user data based on role using SQL?
- $wpdb not working
- WordPress character set issue
- Link wordpress with a SQl + MongoDB + .NET
- How to add data from wordpress tables to new database tables you have created
- Getting deleted users in database
- Install WordPress with SQL database
- SQL query : Select a thumbnail for a media
- Importing Concrete5 content to WordPress
- why you don’t Implement PDO for access every thing to database
- SQL Query to get post_id from wp_posts and and meta_key(s) from wp_postmeta
- SQL query to rewrite all media URLs to end with .webp
- Weird WP -Cli Error Connection Refused