简体   繁体   中英

Backup / Restore wordpress site (change domain)

I have developed a wordpress based website on localhost. I wanted to migrate that on to www.mydomain.com. I checked in all the files from /var/www/wordpress from my localhost to a svn repository. And at the www.mydomain.com, I did a svn checkout. I also exported the wordpress database and imported it to my new domain.

I am using Graphene theme.

I modified all localhost in wp_options table to my domain name. Got it working, but noticed a few things missing.

  • Mapping of my 3 menus, main, secondary and footer
  • A post that I added for my side bar plugin at my localhost, is missing on my new domain
  • Background color setting from Appearance->Background

Am I missing something? A folder or something else?

Edit: Also just read http://lorelle.wordpress.com/2005/12/01/search-and-replace-in-wordpress-mysql-database/

I modified all localhost in wp_options table to my domain name

How did you do that? In a text editor with the database dump? That will break some data in the database.

It's best to use queries in phpmyadmin to change URLs in the database. Use:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.olddomain.com/', 'http://www.newdomain.com/') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.olddomain.com/','http://www.newdomain.com/');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.olddomain.com/', 'http://www.newdomain.com/');

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.olddomain.com/', 'http://www.newdomain.com/');

Use phpmyadmin at your webhost or use it as a plugin; see WordPress › Portable phpMyAdmin « WordPress Plugins.

But it's even better to use interconnectit.com WordPress Serialized PHP Search Replace Tool that correctly deserializes/reserialize data in the database, as using the plain queries above can break serialized data.

And see Moving WordPress « WordPress Codex.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM