Moving whole website to a different server [message #40290] |
Mon, 04 February 2008 20:56 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
I have been happy with version 2.6.4 for several years now (since 2004). At this point, however, the rest of my site is forcing me to change to a "larger" and newer server at the same hosting company. I will be retaining the FreeBSD unix. The support people have moved all the data and folders as follows:
the forumdata folder goes from /usr/local/forumdata to /usr/local/forumdata (In other words, no change.)
The "public" folder, does change path from
/usr/local/etc/httpd/htdocs/wforum to
/usr/local/apache2/htdocs/wforum.
Also, the mysql database changes from version 3.23 to version 5.0, and the data has been dumped, moved, and successfully imported from a database named mysql on the old server to a database named rpimysql on the new server.
I notice that all these paths and names are on the forum control panel. Is there any reason I can't change/update these values and just carry on? Is there some central file that I could modify the values in before launching the forum home page? Or do I have to go to square 1 and install the forum on the new server from scratch?
Thanks.
|
|
|
|
|
|
|
Re: Moving whole website to a different server [message #40311 is a reply to message #40310] |
Thu, 07 February 2008 22:03 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
The log indicated a referencing error at the first executible line of code in index.php, which has to do with requiring './GLOBALS.php'
The support person at the site host company copied this file into the same folder as the index.php is in, and the scene changed. Now my internet explorer displays a whole sequence of message lines, but below them the forum seems to have loaded and displayed ok.
Question 1. Why does the index.php file need the GLOBALS.php file to be moved to its same folder, and what has to change where so it works the way it did on the old site?
Question 2. The new error message is: NOTICE: Only variable references should be returned by reference in /usr/local/apache2/htdocs/wforum/index.php on line 280. This message is repeated for line 214, nine times for line 173, and again for line 214. Where would you suggest I go from this point?
Question 3. Since the screen below these messages seems normal, can I login and get to the admin control panel to rebuild the themes, or should I attempt to resolve these messages first?
|
|
|
|
|
|
|
|
|
|
|
Re: Moving whole website to a different server [message #40335 is a reply to message #40290] |
Tue, 12 February 2008 19:07 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
Thanks.
I changed the GLOBALS.php references to be symlinks in the wforum directory and in the wforum/adm directory, and I changed the /usr/local/forumdata/scr directory to be 777.
However I got essentially the same messages, as follows:
Notice: Only variable references should be returned by reference in /usr/local/forumdata/include/theme/default/db.inc on line 211
Notice: Only variable references should be returned by reference in /usr/local/forumdata/include/theme/default/db.inc on line 207
Warning: copy(/usr/local/forumdata/src/db.inc.t) [function.copy]: failed to open stream: Permission denied in /usr/local/forumdata/include/compiler.inc on line 506
Warning: fopen(/usr/local/forumdata/include/theme/default/security.inc) [function.fopen]: failed to open stream: Permission denied in /usr/local/forumdata/include/compiler.inc on line 367
Couldn't write to /usr/local/forumdata/include/theme/default/security.inc
The theme rebuild appears to stop at this point. Do I need broader permissions on the folders mentioned above?
I'm wondering if the temporary domain name might be causing a problem (because of the security mention).
Since some of my permissions were not set correctly, is there some documentation showing what all the permissions should be?
[Updated on: Wed, 13 February 2008 20:18] Report message to a moderator
|
|
|
|
Re: Moving whole website to a different server [message #40343 is a reply to message #40340] |
Thu, 14 February 2008 00:16 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
I changed the msg_1 file from 775 to 666, and the messages folder to 777, but I still get stopped in exactly the same place, with exactly the same messages, talking about line 506 and line 367 in compiler.inc.
I notice that on our older/current account, the forumdata folder is 711 and most of the folders within are 777. I tried changing the comparable folders to 777, but still no change in symptoms.
I had been using FTP to work with my older account. Since the new one requires SSH for certain functions, I went to the old account and learned that the true path to "see" the forumdata folder with SSH is /usr/home/rpi/usr/local/forumdata. On the new server, the path appears to be /usr/local/forumdata. I don't think this is relevant because the GLOBALS.php file did not use the longer path.
Should I be matching the permissions on the "old" (running) system? The control panel comes up nicely on the new system, but it does stop with the same four messages when I attempt to rebuild the theme.
|
|
|
|
|
Re: Moving whole website to a different server [message #40346 is a reply to message #40344] |
Thu, 14 February 2008 21:13 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
Thanks so much. the theme rebuild appears to have completed normally.
Question: I notice that on the old/existing account installation the permissions are pretty restricted compared to the 666, for example. Should I go over the new system and attempt to set permissions the way the old one is set up?
Also, I am still getting a bunch of warnings and notices such as this one:
Notice: Only variable references should be returned by reference in /usr/local/forumdata/include/theme/default/db.inc on line 211
I assume there is a setting that suppresses them from displaying, but I have not found it if it exists.
NOW, I must have moved from the frying pan right into the fire. I just clicked on my first topic link on the forum home page, and I get this message:
Notice: Only variable references should be returned by reference in /usr/local/apache2/htdocs/wforum/index.php on line 214
Notice: Only variable references should be returned by reference in /usr/local/apache2/htdocs/wforum/index.php on line 214
UNABLE TO WRITE TO SQL LOG FILE
(/usr/local/apache2/htdocs/wforum/index.php:121
/usr/local/apache2/htdocs/wforum/theme/default/thread.php:475
/usr/local/apache2/htdocs/wforum/theme/default/thread.php:496
/usr/local/apache2/htdocs/wforum/index.php:1145
) 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads FROM fud261_fc_view v INNER JOIN fud261_forum f ON f.id=v.f INNER' at line 1
Query: SELECT f.id, f.name, c.name, c.id, CASE WHEN 1200338472 < m.post_stamp AND (fr.last_view IS NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END AS reads FROM fud261_fc_view v INNER JOIN fud261_forum f ON f.id=v.f INNER JOIN fud261_cat c ON c.id=v.c LEFT JOIN fud261_msg m ON m.id=f.last_post_id LEFT JOIN fud261_forum_read fr ON fr.forum_id=f.id AND fr.user_id=2 ORDER BY v.id
Server Version: 5.0.45
|
|
|
|
|
|
|
Re: Moving whole website to a different server [message #40374 is a reply to message #40372] |
Thu, 21 February 2008 03:00 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
Oops.
I had a tech support fellow change the php.ini file so as to suppress all the notices and warnings that were occurring, and then I went to show him the SQL error, and the darn thing worked instead of giving me the error. I was able to look up an actual message. I had been playing around with the ssh mysql interface just a little bit, but only to display databases and tables. I will push the forum software a bit harder, but assuming it works, I assume I will backup the board data on the old site, download it, upload it to the new site, and "restore" it somehow so that it wipes out the data that is currently in place which is a few weeks old now.
|
|
|
|
Re: Moving whole website to a different server [message #40380 is a reply to message #40378] |
Thu, 21 February 2008 18:31 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
I do not understand what is happening. When I attempt to access posts on the forum, it seems to be working perfectly (and for no apparent reason). When I attempt to run the query manually, I get the following, both with "reads" and with "_reads" — It looks like it doesn't like the way the command is broken up on several lines.
mysql> SELECT f.id, f.name, c.name, c.id, CASE WHEN 1200338472 < m.post_stamp AND (fr.last_view I -> S NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END AS reads FROM fud261_fc_view v INNER JOI
-> N fud261_forum f ON f.id=v.f INNER JOIN fud261_cat c ON c.id=v.c LEFT JOIN fud261_msg m ON m.id=f
-> .last_post_id LEFT JOIN fud261_forum_read fr ON fr.forum_id=f.id AND fr.user_id=2 ORDER BY v.id
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'I
S NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END AS
reads FROM fud261_' at line 1
---------------------------------
and when I type it in at the command line instead of pasting, I get:
mysql> SELECT f.id, f.name, c.name, c.id, CASE WHEN 1200338472 < m.post_stamp AND (fr.last_view IS NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END AS reads FROM fud261_fc_view v INNER JOIN fud261_forum f ON f.id=v.f INNER JOIN fud261_cat c ON c.id=v.c LEFT JOIN fud261_msg m ON m.id=f.last_post_id LEFT JOIN fud261_forum_read fr ON fr.forum_id=f.id AND fr.user_id=2 ORDER BY v.id;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads FROM fud261_fc_view v INNER JOIN fud261_forum f ON f.id=v.f INNER JOIN fud' at line 1
mysql>
Why is the forum working?
|
|
|
|
Re: Moving whole website to a different server [message #40382 is a reply to message #40381] |
Fri, 22 February 2008 21:17 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
OK, the messages seem to work ok, but when I go to login as administrator I get:
UNABLE TO WRITE TO SQL LOG FILE
(/usr/local/apache2/htdocs/wforum/index.php:121
/usr/local/apache2/htdocs/wforum/theme/default/msg.php:1091
/usr/local/apache2/htdocs/wforum/theme/default/msg.php:1112
/usr/local/apache2/htdocs/wforum/index.php:1145
) 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'reads FROM fud261_fc_view v INNER JOIN fud261_forum f ON f.id=v.f INNER' at line 1
Query: SELECT f.id, f.name, c.name, c.id, CASE WHEN 1200338472 < m.post_stamp AND (fr.last_view IS NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END AS reads FROM fud261_fc_view v INNER JOIN fud261_forum f ON f.id=v.f INNER JOIN fud261_cat c ON c.id=v.c LEFT JOIN fud261_msg m ON m.id=f.last_post_id LEFT JOIN fud261_forum_read fr ON fr.forum_id=f.id AND fr.user_id=2 ORDER BY v.id
Server Version: 5.0.45
The system appears to let me login, and it appears to run ok afterwards, but I'm still getting this message which looks identical to the earlier ones.
In chasing this with site support people, we did not find it happening after the one occurrance. I was able to login without messages, and everything seems to work perfectly. This seems to be a situational or occasional thing, somehow. In just trying to access a post, it happened again. It seems to happen randomly. When it does happen, the user is surely baffled as to what to do. Any thoughts?
[Updated on: Fri, 22 February 2008 22:33] Report message to a moderator
|
|
|
|
Re: Moving whole website to a different server [message #40390 is a reply to message #40389] |
Sun, 24 February 2008 21:50 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
Yes I have tried the query with square brackets [ ] around the CASE statement. It returns the same error message with or without the brackets, In other words, it never has worked when done as a stand-alone query. But then why does the forum function correctly sometimes? Is there a place in one of the modules where I might attempt to modify some code to add the square brackets?
Here is the excerpted query with the square brackets in place:
mysql> SELECT f.id, f.name, c.name, c.id, [CASE WHEN 1200338472 < m.post_stamp AND (fr.last_view IS NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END]
-> AS reads FROM fud261_fc_view v INNER JOIN fud261_forum f ON f.id=v.f INNER JOIN fud261_cat c ON c.id=v.c LEFT JOIN fud261_msg m ON m.id=f.last_post_id
-> LEFT JOIN fud261_forum_read fr ON fr.forum_id=f.id AND fr.user_id=2 ORDER BY v.id;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[CASE WHEN 1200338472 < m.post_stamp AND (fr.last_view IS NULL OR m.post_stamp >' at line 1
For what it is worth, I seem to be unable to hang the forum as an unlogged in viewer. Once I login, I am unable to access any posts, or topics.
I attempted to look up the syntax in the mysql manual for version 5.0, and I see no syntax issue in the function itself. The manual (for the second version) reads:
CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...] [ELSE result] END
The first version returns the result where value=compare_value. The second version returns the result for the first condition that is true. If there was no matching result value, the result after ELSE is returned, or NULL if there is no ELSE part.
mysql> SELECT CASE 1 WHEN 1 THEN 'one'
-> WHEN 2 THEN 'two' ELSE 'more' END;
-> 'one'
mysql> SELECT CASE WHEN 1>0 THEN 'true' ELSE 'false' END;
-> 'true'
mysql> SELECT CASE BINARY 'B'
-> WHEN 'a' THEN 1 WHEN 'b' THEN 2 END;
-> NULL
The default return type of a CASE expression is the compatible aggregated type of all return values, but also depends on the context in which it is used. If used in a string context, the result is returned as a string. If used in a numeric context, then the result is returned as a decimal, real, or integer value.
Note
The syntax of the CASE expression shown here differs slightly from that of the SQL CASE statement described in Section 17.2.10.2, “CASE Statement”, for use inside stored routines. The CASE statement cannot have an ELSE NULL clause, and it is terminated with END CASE instead of END.
[Updated on: Mon, 25 February 2008 20:40] Report message to a moderator
|
|
|
|
|
|
|
Re: Moving whole website to a different server [message #40409 is a reply to message #40408] |
Wed, 27 February 2008 01:21 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
OK, although I don't know what the word "reads" is doing in the query (is it a variable or a keyword of some sort?), I was able to verify in the manual that both "READ" and "READS" are reserved words in mysql 5.0. Now that I have learned how to do a manual SELECT, I was able to change "reads" to "_reads" and the query appears to work, at least in terms of syntax:
mysql> SELECT f.id, f.name, c.name, c.id, (CASE WHEN 1200338472 < m.post_stamp
-> AND (fr.last_view IS NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END)
-> AS _reads FROM fud261_fc_view v INNER JOIN fud261_forum f ON f.id=v.f
-> INNER JOIN fud261_cat c ON c.id=v.c LEFT JOIN fud261_msg m ON m.id=f.last_post_i
d
-> LEFT JOIN fud261_forum_read fr ON fr.forum_id=f.id AND fr.user_id=2 ORDER BY v.id;
+----+--------------------------------------+------------------------------ -----+----+-----
---+
| id | name | name | id | _rea
ds |
+----+--------------------------------------+------------------------------ -----+----+-----
---+
| 12 | Current Books, Articles, Films, etc. | Religion and Ministry Discussions | 3 |
1 |
| 22 | Whole-Community Catechesis | Religion and Ministry Discussions | 3 |
0 |
| 19 | Current ML Issue | Religion and Ministry Discussions | 3 |
0 |
| 15 | Environment & Art | Religion and Ministry Discussions | 3 |
0 |
| 17 | Liturgical Music | Religion and Ministry Discussions | 3 |
1 |
| 16 | Liturgy and Liturgical Ministry | Religion and Ministry Discussions | 3 |
1 |
| 8 | Pastoral Ministry/Social Justice | Religion and Ministry Discussions | 3 |
0 |
| 14 | RCIA and Catechesis | Religion and Ministry Discussions | 3 |
0 |
+----+--------------------------------------+------------------------------ -----+----+-----
---+
8 rows in set (0.22 sec)
-----------------------------------------------------------
Just generally, what should I do? Can I search through the php looking for "reads" and changing it to "_reads"? What about "read"? Can you tell me what the word "reads" means in the query we have been working with?
|
|
|
Re: Moving whole website to a different server [message #40420 is a reply to message #40409] |
Wed, 27 February 2008 23:34 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
I tried looking through the code files (having no idea where to really start looking, and I do not find the exact query anywhere — by eye. I did not look for it with a search function.
I did find a couple dozen CASE functions, but all but two or three of them already have enclosing parentheses around them. (attach.inc.t, forumsel.inc.t, and index.php.t need parens)
I did not see any reference to "reads." Can you give me a hierarchy of forum files, or maybe just tell me where to look first, second, etc.? Would I start with the include folder? Or with a template folder? If I do make a code change, what do I do to make it "live" — or does that depend on where the change occurs?
|
|
|
|
Re: Moving whole website to a different server [message #40426 is a reply to message #40420] |
Thu, 28 February 2008 00:40 |
WilliamBurns
Messages: 123 Registered: March 2004 Location: San Jose, CA
Karma: 0
|
Senior Member |
|
|
I believe I have found the query: It is in my forumdata/include/theme/default/forumsel.inc. Here is the operative section, with th e CASE info on line 1:
$c = uq('SELECT f.id, f.name, c.name, c.id, CASE WHEN '.$GLOBALS['usr']->last_read.' < m.post_stamp AND (fr.last_view IS NULL OR m.post_stamp > fr.last_view) THEN 1 ELSE 0 END AS reads
FROM fud261_fc_view v
INNER JOIN fud261_forum f ON f.id=v.f
INNER JOIN fud261_cat c ON c.id=v.c
LEFT JOIN fud261_msg m ON m.id=f.last_post_id
'.($mod ? '' : 'LEFT JOIN fud261_mod mm ON mm.user_id='._uid.' AND mm.forum_id=f.id INNER JOIN fud261_group_cache g1 ON g1.resource_id=f.id AND g1.user_id=2147483647 LEFT JOIN fud261_group_cache g2 ON g2.resource_id=f.id AND g2.user_id='._uid).'
LEFT JOIN fud261_forum_read fr ON fr.forum_id=f.id AND fr.user_id='._uid.'
'.($mod ? '' : ' WHERE mm.id IS NOT NULL OR ((CASE WHEN g2.id IS NULL THEN g1.group_cache_opt ELSE g2.group_cache_opt END) & 1) > 0').'
ORDER BY v.id');
Should I change it? If I do, what do I do then. I still have no idea about "reads".
[Updated on: Thu, 28 February 2008 04:07] Report message to a moderator
|
|
|
|