Maybe I did not explain it clearly or don’t understand the “moving a new and active domain to Dreamhost” clearly. I would reason that most customers, with an active website, when moving to Dreamhost has gone through this same process to some degree. i.e.
For a CMS-oriented website, such as Wordpress, this will allow you to test it, make sure the page loads are okay, and that everything looks correct before you move your real domain.
At this point, your domain is still hosted by old ISP. But a duplicate test copy is up on Dreamhosters.
You want to test the domain (while dns is still not moved) on Dreamhost
From the SSH session, you can see that now you have two folders sitting parallel to each other, which is something like:
/home/example.com (this is your real domain once dns is moved)
For this also, you have created a database (Goodies -> mysql databases) and you have created a hostname such as: mysql.example.com
Dreamhot, however, allows you to reach to “example.com” (on /home/example.com) even when it is hosted at old ISP. The way you do it is …
add example.com in hosts file on your PC/Linux host at home and point the domain to DNS IP of Dreamhost
(recall, Unix checks /etc/nsswitch.conf where usually it is listed as “hosts dns”. If it is like that, hosts translates to /etc/hosts and dns translates to /etc/resolv.conf. In other words, it will look into hosts file before it gets to DNS stub file)
On my Linux host at home, I can do this with no problem. i.e. in the browser I can pull “example.com” from Dreamhost and not from my real domain from old ISP.
Anyways, in case someone else was stuck at this point, here is how I dumped and loaded MySQL from my database on example.dreamhosters.com to my database on example.com (again, the one that is hosted on Dreamhost. The actual domain on old ISP is untouched).
Any database you create for any domain within the account is available to any other domain. Your browser does not need to know where mysql.blah.tld is - that’s just a name that the WP script to uses to connect internally (like localhost).
You don’t need 2 mysql hostnames or 2 databases.
When using the HOSTS hack you don’t even need a dreamhosters sub-domain.
Point 2 was clear to me; I am trying to keep both the example.dreamhosters.com (for testing - such as downloading new plugins etc to ensure it does not mess up the format of the main website. So data here will be a subset of the example.com) and example.com.
a. Do I need to download and run “search and replace” tool or some plugin that does similar thing, by replacing “example.dreamhosters.com” with “example.com” (which will run on the db tables and on static php files across the entire /home/example.com folder structure?
b. manually and carefully change wp-config.php - adding the right db name/password etc.?
c. Any other points/caveats/gotchas I need to be aware of?
Please share a link if it is already explained somewhere.
For the benefit of anyone reading the thread, I was able to make the site work last evening (till what is discussed in the thread; there might be some more challenges ahead). Here are some details if anyone is following this thread. Also, there is a possibility that a few things maybe out of sync since I have done these in bits and pieces and trying to remember the steps.
Original site, say example.com, is still hosted at old ISP and nothing is changed there.
On Dreamhost, I have setup two parallel sites/folder structure
/home/example.dreamhosters.com - test site so I can see load time before hosting on Dreamhost, test plugins to ensure it does not mess up site looks etc.
/home/example.com - set by Dreamhost and future home of my main website once I move dns to Dreamhost
FTP client in use is FileZila though being a nix person, I use SSH whenever I can
Created WP site structure, added posts and pages under "example.dreamhosters.com"
Note: I did a dump and load from old site but the site format looked a bit messed up. Given that the original site is not in WP and WP footprint is very small, I decided to recreate it.
With above in mind, following are the steps:
STEP 1. Copy Wordpress files (themes, plugins, etc.)
Copy everything from /home/example.dreamhosters.com to /home/example.com
a. Login to Dreamhost via SSH and do:
You can edit this file in Notepad or Wordpad and really do all the search & replace of “example.dreamhosters.com” with “example.com” and then import this file to “mysql.example.com”. However, if your db is big, this can become a tiring process and you may miss something. I don’t recall now if Notepad and Wordpad has a feature that does global search and replace (i.e. once instead of prompting you to change every instance)
b. Upload .sql file to the root of your WORDPRESS site
Use FileZila or any ftp client to move .sql file from PC to Dreamhost to folder “/home/example.com”
and import the .sql file. It might even pick the file from your PC. I didn’t try this but I am fairly sure it works.
STEP 3: Intial Testing of site (while dns is still not moved)
On my nix (linux/unix) host, I added Dreamhost DNS in /etc/resolv.conf, and in the browser pulled it as: http://example.com. It will pull the main page but none of the links will work for now ( you can howver on the categories and it will show still as “example.dreamhosters.com”)
Note: I haven’t quite figured out this ritual. Maybe I need to empty cache used by WP Super Cache or any other cache plugins.
However, this does seem to “refresh” links. If I just pulled my site (example.com) on the nix host with temp dns, the links still showed from old “example.dreamhosters.com”.