Hi,

I just recently finished a website and ama curious as to how I can upload said website to a live server, and having it still function. I created everything on my localhost so Im not sure what sort of things I'll need to change or edit to make it functional online. Thanks.

Comments

vm’s picture

heres what I do.

set site in offline mode
turn off clean urls

using phpmyadmin
clear cache tables
clear sessions table
clear watchdog table

export DB

import the export into a new DB on the new server
transfer the files from the local install

adjust settings.php manually to point to the new DB. ie find line $db_url

once files and DB is complete
log back into the site
turn clean urls back on
set site back online
test

iamchel’s picture

Thank you! That is exactly what I was looking for.

jhun vert’s picture

Thank you for this step by step tutorial.

radswork’s picture

Does Drupal need to be installed on the live site? I have uploaded all the files and imported the database. But it asks me to install drupal.

vm’s picture

that would likely mean you didn't follow "adjust settings.php manually to point to the new DB. ie find line $db_url"

if no $db_url exists, drupal think its needs to be installed.

Lydia Orsi’s picture

this might sound like a stupid question but I wanna make sure I don't do anything I shouldn't... what do you mean by 'clear' tables?

vm’s picture

empty them using your database tool. note: empty not drop.

daryand’s picture

hi. first, thanks for the great post and instructions. second - can you please help me decode this error message?

PDOException: SQLSTATE[HY000] [2005] Unknown MySQL server host 'http://www.myati.net' (3) in lock_may_be_available() (line 164 of /includes/lock.inc).

when i developed my site, i used MAMP - and specified it as 'localhost'

thanks,
daryan

vm’s picture

check with host. If localhost isn't to be used, then you need to edit setting.php where this is set

daryand’s picture

hi. i've solved the basic newbie question on the host. but now the db presents a lock error. any suggestions?

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'TRADITIONAL' in lock_may_be_available() (line 164 of /includes/lock.inc).

thanks,
daryan

vm’s picture

not sure where the lock is coming from. Ensure all cache tables are cleared before of after the move.

Based on these google results (always the best place to start) = http://tinyurl.com/3ltvbbf the problem is an issue with the version of MySQL in use. See drupal.org issue http://drupal.org/node/344575

What version of MySQL is in use?
What is the exact version of Drupal 7 in use?
How was drupal installed? native installer or fantastico/cpanel/one click host install?

kjellbronkhorst’s picture

Having the exact same problem here. Can't figure out what i'm doing wrong. i've changed the database name, username, password, and host but it also gives me the exact same error as the one you refer to as the ''basic newbie question''. Could you tell me how you solved the matter?

Thanks,
Kjell

m_i_c_h_a_e_l’s picture

I guess "subscribe" is the best way to bookmark something on this site.

vm’s picture

browser favorites work great too

m_i_c_h_a_e_l’s picture

You know, the thing about Drupal is, it seems to make you look for solutions that are harder than they have to be! :-)

Thanks VM. I guess I couldn't see the forest for the nodes.

Anonymous’s picture

Just out of interest - what will happen to the urls when I do this...

At the moment, say, for my search function the url comes up as http://localhost/drupal-7.0/search/node/blahblah

What will this become once it's uploaded to a webserver?

vm’s picture

paths are relative to index.php thus, localhost/subdirectory won't matter unless you've hardcoded them (anywhere)

after the move clear your cache tables in the database ensuring that old cache which included the localhost path are emptied.