WCATX: Moving Sites and Managing Domains
In his presentation at WordCamp Austin 2013, presenter Chris Weigman, Senior Developer at Springbox, talked about the steps required in moving domains and changing web hosts.
Why Move a Domain Name?
- You’ve outgrown your shared or other host
- You want a new host
- You want a development site
- You’re rebranding your site
- You picked the “wrong” domain name
What are Domain Names?
- Associating number, called an IP address, with short handle
- A numerical name assigned to every device on the internet
- Maps a human readable name to an IP address
- Example: Facebook.com is the same as
- 0:0:0:0:0:ffff:adfc:6e1b (IPv6 Expanded)
- 10101101.11111100.01101110.00011011 (binary octets)
- 2919001627 (decimal)
- 184.108.40.206 (IP address)
Doman Names and WordPress
- Your server your host on has an IP address
- IP addresses are set in DNS
- Many shared hosts have many sites on a server
- This is why you can’t often to your site by just entering the IP address
- You’re have to pay for a unique IP address to access it directly
- DNS entries are cached–often for days
- Tip: Don’t register your domain name with your web host If you get locked out of the web host, you will also get locked out of your domain name.
- Services that provide easy migration:
- What you will need for manual migration:
- A good backup
- Access to DNS
- Direct access to database on both hosts
- Access to wp-config.php and .htaccess files
- New username and password
- What you will want:
- Navivat, a database management tool for transferring databases between servers
- Forklift, very FTP software
Preparing for the Web Host Move
- It’s easier to deactive on old host and reactivate on new host
- One week out from the move:
- Lower the TTL (Time To Live) setting on your domain to 1 minute
- One day out from the move:
- Make sure you have access to files and databases on both hosts, passwords, addresses, etc.
The Web Host Move
- Create a fresh backup
- Create a database on the new host
- Write down database name, username, password
- Use navigate to copy the old database to the new host
- Use forklift or ftp app to cover over all the files
- Edit wp-config.php
- Update database name, db username, password
- Update path info if preset (you’ll have to get this from your host)
- Update .htaccess, if necessary
- It’s easier to deactivate and then reactivate plugins
- Change the DNS address (and it will take time to propagate through the Internet)
- Test the site to see if it’s changed.
- If something goes wrong, simply change back DNS and start over
After the Web Host Move
- Increase TTL on your DNS to one day or more
- Close old hosting account
Moving Web Hosts Tips
- If you’ve outgrown your shared host don’t get another shared host
- Warn your users that a move is happening
- Test your backup
- See if your host can migrate it for you. Most web hosts offer services to make this move for you.
What to Watch Out When Moving Web Hosts
- Domain/host are on the same account
- Plugin settings – some plugins will need their settings resaved
Changing Domain Names
- A domain name is nothing but an alias to the IP address of your site
- What you will need:
- IP address of your host
- Access to your site via FTP/SFTP
- Note: cPanel or other host access will work as well
- The username/password of your database
- In WordPress, found in the wp-config.php file
- Search and Replace DB
- This small PHP script replaces every instance of old domain name to your new database with your new domain name.
Moving Domain Names
Tips for Moving Domains
- Keep domain name separate from you web host
- Watch Google very closely
- Don’t turn off the old domain, just redirect it.
What to Watch Out When Moving Domains
Create Dev Environment
- Create a domain name for your computer or local IP
- Copy Files and database to local computer
- Changing domain name and host
- Use GitHub/DeployHQ
- Separate branch for production/dev/merge and deploy
- Use host staging area (WPEngine and others) if not a developer
Putting It Together
- Changing domain names really just require changing the database and .htaccess/wp-config.php to replace the old with the new.
- Changing hosts requires only the changing of the server address and updating the wp-config.php on your host once database and files are directly copied over
- A dev environment is just copying host and a new domain to your local machine.
- The 2 biggest point of failure
- Not making sure the new works before turning off the old.
- System failure without a backup.