Testing a site change

I am curious how others test major changes to their sites.

I need to make a change, and I need to completely test it before loading it up.

Should I create a subdirectory, and copy everything, including databases to this directory and work on it there?

We are a small business, and in the past, I have always stumbled through changes to the live site during off hours.

All suggestions are appreciated.


I use subdomains - frex, when I need to test a new site for “www.example.com” I create a new subdomain called “dev.example.com” and test mods there. Same with databases (more or less); I’ll usually have a “mysql.example.com” and a “mysqldev.example.com” to keep routines that update data from interfering with live site data.

i run my own linux server (in my basement) with apache, php, and mysql. my code is on subversion and both the live site and the my server are working copies. i do my development using the working copy on my server and i can test it right away. granted it is a slightly different setup than dreamhost since i don’t have the same versions of everything and i don’t run php as cgi, but it’s a good enough test for me. when i’m happy i just commit my changes to subversion and the live site gets updated automatically (through a subversion hook).

track7 - my dream-hosted site

That sounds like a nice setup, and maybe a long term goal, but I am liking the sub-domain method. Any tips or warnings would be appreciated.


The first “tip” or “warning” I’d suggest is probably obvious, but just in case (and since you asked):

You should take care to make all your URLs in links and scripts, and all your paths, relative instead of absolute (or stated absolutely in terms of system variables) so when you “go live” a lot of stuff doesn’t break. :wink:


Thanks for the help.

Are there any “shortcuts” to duplicating site content and mySQL onto a subdomain?


Depends - I’m sorta fussy about my directory structure which means I don’t use the DH default - I create a top-level directory for each domain and put the home directory for each subdomain under that so that creating additional subdomains is simply a matter of a copy command. Again, frex:

www.example.com points to "/home/username/example.com/www/
dev.example.com points to "home/username/example.com/dev/

…and so forth. That way if I wanted to make another development site it’s simply a matter of pointing the new subdomain to another subdirectory via the DH control panel then just copying the code en masse to the new directory.

Copying SQL data is simply a matter of using phpMyAdmin to Export as SQL from the live database and copying the output then going to the development server and paste the copied SQL for execution. Unless you’re like me and spent $$ on a good remote SQL client that can do that for ya.

PHPmyAdmin has an import limit that is way under my database size.

Any ideas how to copy an entire database to a new domain?


You’ll have to do the mysql import it from the command line. See Wiki articles on “Importing mysql” and SSH.

You can easy copy the data from one domain to an other via SSH. The command would go something like
cp -rf /home/user/domain.com /home/user/sub.domain.com

art.googlies.net - personal website

I’ve read you cannot just copy the data, that it needs to be exported and imported. I will use a PHP script.