Changing domain names for WPMU and lighttpd
- Stop lighttpd
- I had to change my DNS records at my provider and update with a new domain to take over for the lost one .
- Modified /var/www/wp-config.php variable DOMAIN_CURRENT_SITE with the new domain
- Modified /etc/lighttpd/lighttpd.conf and replaced the old $HTTP["host"] entry
- Unfortunately WP sticks the domain name of your primary site EVERYWHERE in the database which was a real bummer. After I had found it in more than a few places I decided I’d better dump the database, replace using vi and then import the database back.
- mysqldump -u username -p wp_databasename > databasename.sql
- I then used vi to do a global replace of the old domain with the new
- I then dropped the old database and recreated it with the same name.
- Importing the database is easy with mysql -u username -p wp_databasename < databasename.sql
- Restart lighttpd
I think that’s it. It seems to be working again and hopefully this will help someone out of a jam in the future.
Word of caution: I’d do a backup of everything before I starting and I also can’t promise that this will work if some WP plugin is doing anything strange with the domain name. Good Luck.