NEED TO CHANGE webhost....

NEED TO CHANGE webhost....

by Chris Sutherland -
Number of replies: 17
I currently use Dreamhost with net2ftp which puts a limit on the size of files I can upload. The max is 4,882kb. I have files as large as 14,000kb.

Can anyone give me a suggestion as to what i should do? Change webhost? and if i should then to who?

Are there any free FTP that i can change to without changing Dreamhost? Not sure how i can do this other than start all over and switch my domain to someone else that allows larger files to be uploaded, and recreate all my classes.

Any help is very appreciated.
Average of ratings: -
In reply to Chris Sutherland

Re: NEED TO CHANGE webhost....

by Dan Hilke -
SmartFTP is a free program that works pretty well.

As far as hosts, I've been very happy for years with TotalChoiceHosting.com; but because of the cost savings of unlimited domains on one account I'm in the process of moving to BlueHost.com - they seem good too, except that I've just found that moving my moodle database is not going well (it doesn't retain it's UTF8 setting when I restore it at BlueHost - that's a problem!)

Dan


In reply to Dan Hilke

Re: NEED TO CHANGE webhost....

by Richard Enison -
DH and whoever else is interested,

For more on BlueHost vs. UTF8, see http://tracker.moodle.org/browse/MDL-11743.

RLE
In reply to Richard Enison

Unicode conversion : latin1 => UTF8

by Dan Hilke -
Richard,

I've spent quite a bit of time today looking through the forum posts for something to help me, and found a couple threads that you were involved in regarding MDL-11743, and I scanned through that too. But most everything I find has to do with people that have databases that ARE in fact UTF8 but moodle isn't recognizing it and the install hangs up; my problem is not the same.

I did a backup of a UTF8 database on a working 1.9.1+ moodle, and then went to BlueHost and tried to use that file to do a 'restore', (both hosts use the same cPanel interface) but it ended up as LATIN1. I ran the SQL-queries that you've asked people in the other threads to run (SHOW VARIABLES LIKE 'character_set_database'; -and- SHOW LOCAL VARIABLES LIKE 'character_set_database' ) and the result is "latin1" either way. Since I can't use the 'import' feature because of the size of the backup file, and the 'restore-db' feature automatically turns it into LATIN1, I need to figure out how to convert the database from LATIN1 to UTF8 after doing the restore. I'm assuming that's possible...

This is new to me, so I'm just not sure exactly if these things do what I want, or how to get the syntax right, but I'm finding a couple things that look like what I need. Maybe.
In the tracker item you linked to, I find this:

ALTER DATABASE `moodle_db` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
What exactly does that do?

Also, in the MySQL manual I find this:

9.1.7.2. CONVERT() and CAST()

Example:

SELECT CAST(_latin1'test' AS CHAR CHARACTER SET utf8) COLLATE utf8_bin;
What exactly does that do??

Thanks for any help!
Dan


P.S. - I just now noticed something more. Looking at the structure view of the restored database, the "Collation" column shows every table as "utf8_general_ci", but then at the bottom there's like a summary, that says "199 tables; Sum; 8,632; MyISAM; latin1_swedish_ci"

Maybe my problem isn't even what I thought my problem is...
I need help understanding all this!

In reply to Dan Hilke

Re: Unicode conversion : latin1 => UTF8

by Richard Enison -
DH,
  1. Yes, MDL-11743 is about Moodle not recognizing databases (db's) that are Unicode-compliant as being so. The reason this happened at certain web hosts, including BlueHost, is that Moodle uses (for MySQL db's only) the SQL query

    SHOW VARIABLES LIKE 'character_set_database';

    to find out whether the default character set of the db is UTF8. This is supposed to be the same as

    SHOW LOCAL VARIABLES LIKE 'character_set_database';

    according to the MySQL manual, but at BlueHost and one or two others (at least), it turns out that they somehow changed the way that query operates, making it the same as

    SHOW GLOBAL VARIABLES LIKE 'character_set_database';

    which means that even though the character set of the db is UTF8, because the default character set of the (db) server is Latin1, that's what the query returns, causing Moodle to reject the db. The solution was to change Moodle to use the query

    SHOW LOCAL VARIABLES LIKE 'character_set_database';

    instead. The fact that MDL-11743 mentions how your host, BlueHost, was doing non-standard things with MySQL queries relating to character sets and Latin1 vs. UTF8, is the reason I referred you to that Tracker issue.
  2. In order to know how to fix the restore-db problem, I need to know exactly what it is doing. If it is just making Latin1 the default character set of the db without messing with the data itself, then I believe the ALTER DATABASE query you show (don't forget the semicolon at the end!) should do the job. If it is actually converting the data from UTF8 encoding to Latin1, that's a much bigger problem. Then you would need to create a script to convert every text field in every row of every table in the database back to UTF8, like the db migration script in Moodle 1.6 and 1.7. I could be mistaken about that; I may have it backwards. In any case, it is probably simpler to start over: drop the db, make a new one with CREATE DATABASE specifying UTF8, and restore the db dump into it. Or is that what you did?
  3. The SELECT query you show doesn't do anything to the db, because SELECT queries just display data; they don't modify db's.
  4. The fact that your structure view shows that every table has a UTF8 collation suggests that the data is already okay, only the db default (which is what the Moodle environment check looks at) needs to be changed. In that case the ALTER DATABASE query should take care of it.
  5. The main thing you need to understand is that there are default character sets and collations at several levels: column, table, db, connection, server. The character set of a column determines how text data in that column is encoded, i.e., what string of bits is used to represent each character. The default character set of a table becomes the character set of any column you add to that table unless you specify otherwise. Similarly, the default character set of a db determines the default character set of a table that you add to the db unless you specify otherwise. In the same manner, the default character set of a connection determines the default character set of a new db, and that of a server, a new connection. And of course, the same applies to collations at all levels.
RLE
In reply to Richard Enison

Re: Unicode conversion : latin1 => UTF8

by Dan Hilke -
RLE,

You explain things very well, and I appreciate the lesson! Thank you.

I ran the ALTER DATABASE query from my last post, and it worked. When it finished running, I checked the structure view again, and latin1 changed to utf8_unicode_ci on that summary line at the bottom. When I went back to my moodle page, the installation check for database was fine, and the installation continued right on! (I ran into some errors that I have to figure out, but I'm certain they are not related to this problem...)

As far as your #2 - I did not create a new database on the BlueHost server and then load the backup file into it. If I could use the 'import' feature, I believe that's how I would have to do it, but because of the backup file size, I couldn't even try that. I simply clicked "backups" in the 'Files' section in cPanel, and there found a place to "Restore a MySQL Database" with a button to 'browse' to the backup file on my hard drive, and it uploaded the file and created the new database all in one step.

After the additional step of running the ALTER DATABASE query, moodle accepted it without any more problem.

Thanks again for the help!
Dan

In reply to Richard Enison

Re: Unicode conversion : latin1 => UTF8

by Chris Craft -
I am having the same issue as others, it seems. Tragically, I can't make heads or tails of how to fix it.

I am using Bluehost, running PHP 5.2.6 and MySQL 5.0.45, phpmyadmin 2.11.6.

I'm dealing with a production Moodle install, formerly running 1.8.2+. It's been running stable for year now and it's time to upgrade.

This was initially a 1.6 install, so it was upgraded from there so the unicode issue would have been tackled a bit there.

And yes, I have been all through the bug tracker thread. I am just lost.

It began like this...


sql

So then I ran the alter commands as was indicated in many posts. Now it reads...


sql3

Yet I still can't run the upgrade script.

I did this command if it helps..


sql2

To see a screenshot of the error I get when I try to run the script, click here.

Any help is appreciated as I have a non-functioning Moodle now. I do have a backup of both the directories and the original SQL so I could restore, but I'd like to get this resolved.

FYI, I did try the patched setuplib.php.diff files (and yes I renamed them) and both threw crazy errors.

The collation of my Bluehost database in phpmyadmin is set correctly, to the utf8_unicode_ci.

Can you help?

Thanks so much!

Chris Craft
In reply to Chris Craft

Re: Unicode conversion : latin1 => UTF8

by Richard Enison -
CC,

OK. It looks like you've done the right things to get your database (db) to be Unicode compliant, and to confirm that. But I'm a little confused. You talk about formerly running Moodle 1.8.2+, then you talk about it being initially 1.6. Which version of Moodle are you trying to upgrade from, and which one are you trying to upgrade to? Which version were you running when you produced the screenshots before and after running the alter database query? Which version produced the error msg. screenshot your post links to? Did you run the db migration to Unicode script when you were running 1.6?

I just noticed that there is a check that Moodle does when you upgrade, and I'm not sure whether it does this before or after actually testing the db for Unicode compliance, but if the check fails it produces exactly the error msg. you got. It looks at a flag that gets set and remembered in the db and in config.php (I think) whenever the db test is performed and fails. So here is my recommendation at this point. Put this line of code into config.php in your main Moodle folder (directory):

$CFG->unicodedb = true;

RLE
In reply to Richard Enison

Re: Unicode conversion : latin1 => UTF8

by Chris Craft -
That did it!

It was a tumultuous upgrade process, with me getting this a few times...


sql6

And then finally, after a few minutes of it working, and then a few more clicks on the continue button I hit the !!! and it took me through.

After another five or so minutes of the usual "no warnings, scroll to continue button" I got this..

sql6

So I am up to date!

This just proves that you in fact CAN upgrade on Bluehost.

FYI I was upgrading from 1.8.2 to 1.9.2. I had previously upgraded TO 1.8.2 from 1.6.x.

The site seems to be working fine. Thank you so much for your help!

Yours,

Chris Craft
In reply to Chris Sutherland

Re: NEED TO CHANGE webhost....

by Marc Grober -
Dreamhost will provide you with virtually everything you need. If you search the forums you will find extensive postings within the last 4 months describing how to install, set up and run your moodle on dreamhost, as well as suggestions for clients such as bitwise tunnelier, which I use (I am a dreamhost user).

You will also have by now also looked in dreamhost's wiki and discovered that there is a page there on moodle, together with an invitation to note anything you wish the page to discuss.

After you have reviewed the recent forum postings (clicking here will get you the posts I have made on the subject: http://moodle.org/mod/forum/search.php?id=5&words=dreamhost&phrase=&notwords=&fullwords=&hfromday=1&hfrommonth=1&hfromyear=1&hfromhour=1&hfromminute=1&htoday=1&htomonth=1&htoyear=1&htohour=1&htominute=1&forumid=0&subject=&user=Marc+Grober), looked at the dreamhost wiki on moodle and custom php.ini and selected and installed an ftp client (as I mentioned suggestions and installation comments appear in the forum on using bitwise tunnelier which will provide you shell access, sftp and ssh access) I will be happy to walk you through any issues in the forum or you can message me.

In reply to Marc Grober

Re: NEED TO CHANGE webhost....

by Chris Sutherland -
I was reading the pricing for tunnelier. The fee's are very confusing. I would be using it for teaching classes on line. Do i fall under the free category?Also, if i already use net2ftp is it possible to change to tunnelier?
In reply to Chris Sutherland

Re: NEED TO CHANGE webhost....

by Marc Grober -
The issue is the license which indicates if you are using it yourself it is free, but if you are using it in an environement where more than 4 people are using tunnelier, the enterprise must purchase licenses. http://www.bitvise.com/files/Tunnelier-EULA-20051002.txt
It sounds like you are the only one who would be using tunnelier, therefore it is free..... download it.

Then read the forum postings I referred you to.... do NOT use net2ftp... I repeat, DO NOT use net2ftp.


In reply to Marc Grober

Re: NEED TO CHANGE webhost....

by Chris Sutherland -
Ok. I am on my way over to download tunnelier. I'll read your other stuff you referred me to but i sure hope you will be around to help me cause i will need it. im soooo in the dark with all of this stuff. thanks.

In reply to Chris Sutherland

Re: NEED TO CHANGE webhost....

by Chris Sutherland -
Marc- its downloaded. now what?

In reply to Chris Sutherland

Re: NEED TO CHANGE webhost....

by Chris Sutherland -
Marc-
I have successfully logged in to tunnelier. I cant find any of your past posts on how to change the max upload size, which is the reason i just changed to tunnelier. Can you tell me how/where/what to change?
thanks
In reply to Chris Sutherland

Re: NEED TO CHANGE webhost....

by Chris Sutherland -
Marc-
I attempted to upload my first large file. I can't believe it,... it actually worked!! I don't understand how, i didnt make any changes to the max upload size or anything. I'm not sure how or why its working but it is so im not going to worry about it.

Now... i do i make changes to different things? I want to copy the standard them and customize it. Not sure how to do that through Tunnelier????

Thanks again for your help!
In reply to Chris Sutherland

Re: NEED TO CHANGE webhost....

by Marc Grober -
search in the forums and docs under "max upload" and you will figure that out as well.... the net2ftp is a pitiful little program that is self limited. There are limits imposed on file uploads through your webserver and these can be variously addressed either via a custom php.ini (instructions can be found on the dreamhost wiki and links to the instructions in these forums) or .htaccess as well as via the webserver directives which we won't talk about as that won't effect you at dreamhost.

Please, however, go vote for the php upgrades from your panel so that we can urge dreamhost to offer xmlrpc and sockets in their site wide php5 compile