It is that simple for WordPress too. I use the following to back up my WP sites:
mysqldump -u <user> -p<pass> --quick --extended-insert <db-name> > backup.sql
The mysqldump document gives the details on all the parameters.
--extended-insert
is quicker when updating a DB from a dump file and makes the dump file smaller.
--quick
makes the creation of the dump quicker.
You don’t really need to use either of those, just makes things a bit quicker and writing an insert for each row just makes me feel happier – your original dump syntax would be just fine.
Don’t forget though that there is domain-specific entries in the DB so if you are using this method to backup/restore then you are fine but if you want to move from one.com to two.com then you will need to edit entries in wp_options
after you restore your dump.
Related Posts:
- MySQL Syntax Error upon restoring database from backup [closed]
- Why is my database import losing text widget data?
- Export WP database for import using WP-CLI on Vagrant Box
- WordPress database import: Row size too large
- Export / import WordPress database
- How to Mirror WordPress database from Remote server to Local server
- 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?
- Exporting Post ID, Post Title, Primary Category and Primary Category ID
- Featured image from custom to WordPress database
- I broke database after reuploading local version – what exactly happened? Database error
- export individual posts to text files or a single csv file
- Importing Concrete5 content to WordPress
- Problem while importing a site in WPLocal: SQL files fail to import
- Rename a table in MySQL
- How should I tackle –secure-file-priv in MySQL?
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- Export Pervasive to MySQL (C#)
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- How do I import an SQL file using the command line in MySQL?
- How do I import an SQL file using the command line in MySQL?
- MySQL SELECT increment counter
- phpMyAdmin – Error > Incorrect format parameter?
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- Using wpdb to connect to a separate database
- MySQL Database User: Which Privileges are needed?
- Will it break my site if I delete all transient records in wp_options table?
- Checking if Database Table exists
- WordPress (MyISAM) database is slow, should I switch to InnoDB?
- Please explain how WordPress works with MySQL character set and collation at a low level
- The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
- How to fetch Data in WordPress using MySQLi or $wpdb
- WordPress Database lost auto increment
- Connect to database using wordpress wp-config file
- wpdb->insert multiple record at once
- Reset Post IDs to less than 64bit integer
- Restoring WordPress posts from database only
- WordPress database scalability from the code perspective
- How to define composite keys with dbDelta()
- Is it possible to define two databases for one installation?
- Does WordPress use the InnoDB engine for MySQL by default?
- Slow wp_term_relationships query
- How to use “TRUNCATE TABLE” MySQL statement?
- Can I use MariaDB instead of MySQL in wordpress?
- Best way to import users, post and categories from an external database
- What’s the database relationship between a post and its attachments
- Importing posts from old website to new conflicting post ID’s?
- Exporting revisions
- Export wordpress table to excel
- Using Dynamic Data Pulled from a MySQL Table in a WordPress Page
- When importing database, it shows error
- WordPress for a very large website
- What are conventions about the schema of the $table_prefix
- Split WP install between 2 databases?
- Inserting Post Meta From SQL
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- Migrating non-WordPress CMS to WordPress, lots of data to move — possible solutions?
- importing data from non-wordpress mysql db
- Why does dbDelta() not catch MysqlErrors?
- Is deleting orphaned wp_options entries safe?
- Is altering a default WordPress database table update safe?
- How to solve slow WordPress site caused by attachment_metadata
- Huge wp_options table
- “MySQL server has gone away” since update to 3.8
- Delete all post meta except featured image
- Custom DB_COLLATE (collation) value not working on fresh install?
- Export only pages and posts with mysql dump
- What causes the “max_user_connections” warning on WordPress frontend?
- what to do when your WordPress database is too large?
- Change all http to https in mysql databse?
- WooCommerce – Query for ordered products
- Large database causes slow load
- Import 10,000 Users into WordPress WITH a specific ID for each user
- Error establishing a database connection – with Debug Data
- How to execute mulitple statement SQL queries using $wpdb->query?
- Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin
- Database slowdown after update to 3.4.1
- Is a direct or import approach safer for migration into WordPress?
- Can I transfer a mysql database to another site?
- WordPress and automated MySQL backups to a different host
- Database with mixed collation (utf8mb4 & utf8_general_ci)
- Query WordPress database by registered date and role
- Is it possible to import a wordpress backup from a single site in to a multi-site configuration?
- Tons of Twitter rows in my database
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- How to insert data into MySQL database from the form created in WordPress site
- Set Display Name to first and last name (phpmyadmin SQL Query)
- Size article thumbnails and retrieve them directly from database
- Importing New Posts from Live Site into Local Dev Site
- WordPress site uses MyISAM, should I switch to InnoDB necessary?
- Is it safe to convert tables from MyISAM to InnoDB?
- Emojis getting converted to “?”
- Migrating database / content of non-CMS site to WordPress
- Does WordPress ever need multiple databases?
- Why are no posts showing despite my apparently correct DB restoration?
- Select Multiple meta_value from WP DB; Single Query