Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am attempting to setup a test environment that points to the same URL as my production environment in order to make database migrations easier.

Is this something that is possible? One idea that I have is to use a VPN so that if a user is accessing the URL from our VPN we know to send them to the test server.

We are using Ubuntu on EC2. Thanks for the suggestions!

share|improve this question
If you need to use the same URL to make database migrations easier, your app is broken. –  womble May 2 '12 at 13:20
We are simply trying to avoid running an update script on the database because the url could be stored in the database in many places. I guess that could be defined as broken, but I don't think so... –  Mike May 2 '12 at 13:50
Yep, it's broken. I know it's a common practice, but just because everyone's doing it, doesn't make it any less stupid. –  womble May 2 '12 at 15:07

1 Answer 1

Sure is possible.

The idea with the vpn sounds like a good idea. If you can set up a dns server that works over the vpn then you can give the dns-name with the dns ip address once the user is connected.

Another way I have heard of [but might be slightly larger to set up] is to have like a load balancer in front of the servers and let that decide on what server to route the request to (like for instance have ip based rules).

I am not sure about what you are after though, since this would not [the way I see it] make db migrations easier; but that depends on what is in the db I guess.

For web development (php/mysql) I found that having a second domain [and server either virtual or read] like test.example.com was easier to migrate to live.example.com since all files, links and subfolders etc was in the same location was a quick and dirty way to do quick and simple migrations from test to live.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.