Development environment prepared for later migration to live site

Although so many articles have been written about this issue already, the approach I'm using successfully hasn't been mentioned yet - or I missed the appropriate post. Hence I'm writing another one and hope people may find this useful.

What's the issue?

When developing a website for on a development server with a URL/domain which most likely is different from the URL/domain of the live site later on, you will run into trouble when migrating from development to live because of some files and links in nodes and elsewhere being addressed in a location which by default contains the domain name in the path and therefore will be broken after migration.

How to setup development environment to avoid this issue early?

First of all, follow the standard instructions for setting up your new site on the development server. In particular, create the directory DRUPAL_ROOT/sites/ and inside this directory the file settings.php. All the settings inside this file should be standard, so no difference to any other site you would be setting up for Drupal.

In this example we are developing on and to install your site you should next call and follow the instructions.

When done your site is ready. Now, hold on! Before you do anything else you should now change one of the default settings to be ready for later migration:

Let's assume the site will move to later on, please follow these steps:

  1. Create the directory DRUPAL_ROOT/sites/ on your development server
  2. Go to and change the setting in the first field file system path from sites/ to sites/ and save the configuration

Now you're done. You can develop without any problem and once you migrate to the live site, you don't need to change any values or even database content. It's just done.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.