Hello, I have a functional drupal website ready on mu development server. Now I want to install it on the client server.
I made a backup from the database and the fileserver.
Is there a handbook how to deploy this on the client server?

Comments

mpapet’s picture

The only way I've done it is by rsyncing the drupal directory and perhaps your php.ini, apache files. Then exporting/importing the database.

It's one of the many limitations in drupal. It's just not designed for process oriented change management.

I'd be very interested to hear how many user accounts your drupal site will run and if you run into the same limitations I did.

k_and_j’s picture

I had no trouble going live. I read this handbook for an overview and precautions: http://drupal.org/node/120627 , but I didn't follow it step by step. Basically, you're going to unzip/install Drupal on your client server, then import your databases...no need to transfer any files like php.ini, etc... This should not take you very long, so your site may be down ~15 minutes. In my case, it was a new site, so I didn't care if it was down.

Here are my notes (some of these things are more personal preference than necessary):

Upload drupal-5.1.tar.gz to ~/public_html
$ gzip –d drupal-5.1.tar.gz
now have drupal-5.1.tar in public_html
$ tar –xvf drupal-5.1.tar
now have drupal-5.1 folder in public_html will all drupal 5.1 files
rename drupal-5.1 folder to drupal5

Go to MySQL database control
Add database "drupal"
Create user "admin_drupal" with password "******"
Grant admin_drupal all privileges

Single Site Installation:

In ~/public_html/drupal5/sites/default/
Set permission to 777
$ chmod 777 ~/public_html/drupal5/sites/default/
Go to http://mysite.com/drupal5/install.php
Database name: drupal
User: admin_drupal
Password: ******

(Note: needed to clear cache for this to work)

go to http://mysite.com/drupal5/
create first user: (should be the same as what you have on developer version)

Compare modules between development and client (looking for whether modules are downloaded, not necessarily activated/enabled)
Log out and close development and client sites
Export/Backup development database with MySQL as *.sql file
Good idea to Backup client database, just in case.

Note: I had trouble with the database name since my live server prefixes all databases with my username and my local server does not. To fix this, open you local/development database in a text editor and change the following three lines so that "drupal" is replaced with "user_drupal":
Create schema drupal
CREATE DATABASE IF NOT EXISTS drupal;
USE drupal;
Then I re-saved the file with a new name just in case.

Now, go to your client MySQL/phpMyAdmin and import the development database
LOOK at the tables and make sure that everything is OK; with another php-based site, my live and local databases were different in terms of capitalization, so I had a database with twice as many tables that were basically duplicates, but the site ignored the newly imported ones because of this. Basically, you should not see duplicate tables in your database: the new ones should overwrite the old ones.

go to http://mysite.com/drupal5/
It should look identical to what you had on the development server!

-K

schildi’s picture

I wonder if you didn't had problems with absolute path names. That was the reason I could not import the DB dump.

k_and_j’s picture

I didn't have problems with absolute path names...I don't even know where they would crop up. I actually did this as a multisite install, which did require certain considerations, as far as the sites folder and symlinks, but if those are set up the same way relative to each other, there are no issues.

The way I did it, I did not upload drupal itself...I did a clean install first, so only the database is relevant and I would assume it uses only relative paths.

schildi’s picture

My experience is that attached files/images are (always?) stored with absolute path names.

cog.rusty’s picture

There may be something in the Installation and Configuration Guide (http://drupal.org/node/258) but I was unable to to locate it.

The basic drill is:

- Disable Clean URLs, switch to a default theme, clear all your cache tables, your sessions table, your search index tables, your watchdog logs table (for size -- that one can get huge), and take a database dump.

- Upload all drupal files to where they are going to be accessed.

- Create a drupal database and a drupal database user on your server (command line or using your cpanel). Give to the user all permissions mentioned in Drupal's INSTALL.txt and INSTALL.mysql.txt. Also: visit your empty database with phpmyadmin, go to "Operations" and make sure to set the database to collation utf8_general_ci

- Import your database.

- Update your settings.php file with the correct $db_url and $base_url (if any).

That should be all.

You may encounter some problems which have to do with php versions, mysql versions, problems with file links because of differences in Drupal's base path, but those are best addressed as they arise.

cfgauss’s picture

Thanks. This was enormously helpful and worked for me.

The only Drupal files I transferred was the directory /var/www/localhost/htdocs/drupal/sites. Am I correct in assuming that's all I need (as I continue to modify the site on the development box and sync to the live server)?

(Actually, for Clean URL's on the live server, I needed to transfer /var/www/localhost/htdocs/drupal/.htaccess as well.)

cog.rusty’s picture

What is always important for syncing is the database.

You only need to transfer any files if you have new file/image uploads in your "files" directory, new or updated modules or themes, an updated Drupal version, or custom modified theme templates or styles.