Skip to content

Exporting a Drupal site

Some days ago I was in need of exporting, from my localhost to my on-line host, a web site developed with the CMS Drupal in order to continue the work from a server with a similar environment to the production server. I was investigating in the Internet and there was only a little information and it was scattered, so I decided to put them all together in one post.

 1. The database

The first thing that we need to do is to export the database from our local server. We can do it using phpMyAdmin. We have to select the database of our Drupal, click in the tab “Export”. In this screen we have to make sure that the checkbox “Data” is checked and we also have to check the checkbox “Send (generates a file for downloading)”, so we are going to download it as a file with extension “.sql”.

Once we have exported our database from the local server we have to import it to our remote server. For that, we can use phpMyAdmin again. Firstly, we have to create the database with the name that we want, and after this we can import the database that we have exported previously from the file with “.sql” extension. Once we have done this, we have our Drupal web site database in our production server.

2. Directories structure

Now that we have the database, we have to export the directories structure that contains our Drupal from our local server to the production server. To do this, either we can compress the whole web site folder into a .zip file or we can upload the folder without compressing, but it will take much more time. In either case, the end result should be the Drupal folder uncompressed into our public html folder (htmlpublic, public, /var/www or whatever). Also, we have to make sure that the web server has permission for writing in the folder “sites/default” of our Drupal site.

3. Configuring the web server

If we try to access to our Drupal site using the web browser it is possible that we can see the Home page without any problems, but if we try to navigate through the site we will see that the rest of the pages are not accessible. This is because of the web server is not configured properly, since that Drupal uses clean URLs by default (this means that the URL parameters look like /variable/value instead of ?variable=value&…).

Therefore, we have to configure our web server in order to allow clean URL. In this post we are going to explain how to configure our Apache server in case of we have access to its configuration files and administration rights. We have to edit the file:


In this file, in the following code:

Options Indexes FollowSymLinks MultiViewsAllowOverride NoneOrder allow,denyallow from all

We will replace the line:

AllowOverride None

With the line:

AllowOverride All

In this way, our web server will be able to recognize the clean URLs. Once we save the changes made to this file, we have to restart the Apache server and our exporting process will be done. From now on we can use our Drupal site in the Internet without any problems and with all the guarantees.

2 thoughts on “Exporting a Drupal site”

Leave a Reply

Your email address will not be published. Required fields are marked *