Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a proper way of exporting and importing a big WordPress MySQL database to a new database?

When I tried to do that in the standard way I run into 2 issues:

  1. All widgets disappeared and I had to create them from scratch

  2. I had issues with special characters such as ' and I had to search and replace the gibberish letters

This is quite important as I need to move to a managed server from shared hosting. All apache, php, MySQL versions will be the same.

Ps: this will have to be SSH commands as phpadmin times out due to the database size.

share|improve this question

1 Answer 1

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.

share|improve this answer
    
ok, but for text widget you can have problems, have a look here http://wordpress.stackexchange.com/questions/9076/why-is-my-database-import-los‌​ing-text-widget-data –  Glasnhost Nov 15 '12 at 9:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.