Posts Tagged ‘text wrangler’

My Tips for Uploading Drupal Site From Local Computer to Internet

January 12, 2010

I actually had a few problems getting the website transferred from the local host (my computer) to the internet.

Here’s what I did –

I use the free FTP (File Transfer Protocol) called Filezilla, this works on Mac and PC and its real easy to use. There are instructions to explain exactly what to do. They are really clear I think, but I also think that if someone had used another FTP then they could probably work out how to use Filezilla without instructions.

Uploading the files is just a case of highlighting the files on the left side of the filezilla interface, and right-clicking (or control click with a Mac) and uploading to the right-side, where the destination file has been chosen.

By the way- the destination file will be called something like ‘public.html’ and your web hosting company will tell you what this is. My web-hosting company just told me that info in an email where they also outlined the password and username to use. I use the Kiwi Webhosting Company because I am in New Zealand and wanted to use a local company. I bought my domain name from GoDaddy.com and I could have got web-hosting thru them as well but I decided to go with the Kiwi Webhosting company because I am new to all this and they have really good customer help, I am sure GoDaddy would be fine for hosting tho, I am just a bit old-skool sometimes and like to keep it local.

Uploading to the web – Points to remember

Computers are unforgiving – you have to upload the files in the correct folder!

The first mistake I made was to upload the whole ‘drupal’ file from within MAMP. This was wrong because in the top level of the public.html folder there has to be something called index.html. What happens is that the website looks for a default page to upload first and this index file is is the one it is looking for, or at least thats how I understand it and I am sure that is close enough to what happens.

So really how that affects me is that the top level was just one file called drupal and there was nothing for the website to find as a default page.

The solution was to delete the files and start again, which isn’t so bad.

Upload a new settings file to point to your new database.

When you choose your webhosting provider one of the things you have to look out for is to make sure that they have MySQL (which seems to be pronounced my sequel) and PHP, both version 5 or above. Now I don’t really know what these are but I do know that MySQL is to do with the database and that the database stores all the information for my website. I also know that this database was once stored in MAMP and has now been transferred over to my webhosting provider. This was fairly easy after a video tutorial at Learn By The Drop.

Because of the change in location I now have to make a new ‘settings.php’ file to replace the existing one, the purpose of is so that it will point to the correct database and the website will work  😀

This settings file is stored in the defaults foder, inside the sites folder which is inside the drupal folder.

I made a copy of the file and opened it using Text Wrangler (a free programme for writing html and css and php files) and then I found the line that needed changed and I changed it and saved it. I then uploaded it into the correct location on the right side of the Filezilla screen and I was going to be looking at a site on the actual internet!

It should have been so easy….

But even tho I had followed instructions from a few different sources on the internet I just could not get the combination of the name and the password correct. I was upset about it for days. I just could not work out what to do. When it suddenly occured to me…

Ask for help if you need it!

All I needed to do was to email the webhosting company and ask their advice. It wasn’t even difficult. They were really quick to respond and asked me to send the settings.php file as well as to tell me where this file was saved in the file tree.

And then they told me what I had done wrong.

Here is the text I was changing (line 92 in my file) – $db_url = ‘mysqli://username:password@localhost/databasename’;

So I changed username to my username as it is for the webhosting company, the same one that I use to log in to my cpanel. The same with the password. I then put my site name as the localhost and the database name is the one which I created when I copied the database from MAMP to my webhosting provider.

What I did to correct this is that I just changed the localhost back to that word and no longer tried to use the website name. Not sure how that works but it totally does and I am VERY happy with the results!

My site is online and I can work out if this image thing has anything to do with that at all.  Better get back to it…