Skip to main content
Topic: Been a while.... (Read 3932 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Been a while....

Figured I'd check out Elkarte.

Just setting up a new server and I'll test my big board on it (7 million messages). I stopped SMF recording stats a while ago to speed it up - but google analytics shows us have 220k unique users each month(120k registered), and around 2 million page views a month.

Its going to be running on a dedicated server.
- Intel Xeon E3-1230 V3
- 8GB Memory
- RAID Controller
- 120Gb SSD (for OS)
- 2x 1TB 10k RPM VelociRaptor
- RAID 0
- RAID 1
- CentOS 6 x64
- Persona MySQL.

I'll use Sphinx to power the search - and the theme will need to be based on Curve ( to keep the transition easy for members if I fully switch over).

Looking to do this within the next week.

Any recommendations on PHP version?

I've migrated the SMF forum over to the new server, so will clean that up - and then work out how I'll go about the upgrade :)

I don't see many other big boards using Elkart - but looking at the code in Github and the activity, think its a safer bet than waiting around for SMF.

Any tips on migration appreciated :)

Tony





Re: Been a while....

Reply #1

Hi Tony welcome back! :)

Glad to see your interest in converting to ElkArte! That will likely prove to be an interesting conversion indeed!

Sphinx is supported out of the box, so inserting the configuration parameters should Just WorkTM.

PHP version... anything higher than 5.2 should be fine, I'd suggest at least 5.3+ so you'll be fine with Elk 1.1 as well. IIRC this site is running on 5.4, I'm developing and testing on 5.6 (and I guess @Spuds as well).
I'm not so fond on suggesting php 7 just yet because it should work, but there may be some problems at least with the sessions that should be cleaned up before being safe to use (it just means sessions are sometimes not recognized properly and the notice "your session timed out" may appear, not a security issue, but potentially annoying for the users ;)).

Curve: there is a "custom.css" made by TE a while back and based on the BeSocial variant that makes Elk looks almost like SM. You can find it here (you just download the file and upload it to the _besocial directory in /themes/default/css, then set the BeSocial variant to be the default one).
Bugs creator.
Features destroyer.
Template killer.

Re: Been a while....

Reply #2

Hi Emanuele,

I think the box has php 5.6 installed. I develop on 5.6 at work, although recently I've started playing with php 7 using Laravel's framework. Haven't noticed any issues with 7 - but have noticed a little speed increase.

The server itself is dedicated to the forum and a WP install, and nothing else will be running on it until I shutdown the other server. So I've got room to play :)

Should be fun :)

Re: Been a while....

Reply #3

Actually, I did test (not fully) on php 7 and it works. But since I reverted back from ubuntu 16.04 to 14.04, I did no further test.

Re: Been a while....

Reply #4

hello @Tony Reid

From what I know, Elk developers simply refrain from doing aggressive promotion. Like reaching out people to get their boards converted. May be they like giving a good product and waiting for users to find it.

Personally, I am myself amazed that a FOSS which is responsive, have alerts, mentions, likes, two theme variants, community made custom themes and mods are not on many big boards yet.

Let's change it ;)

Re: Been a while....

Reply #5

For 1.0 I'd play it safe and stay with 5.6, I run that on all my sites. 

Use 5.6's built in Zend opCache and your choice of user data cache (apcu is the easiest to setup and fast, can also use Xcache if you shut off its Opcache engine, or memcache if you want). 

A sphinx.conf file will be generated for you via the admin control panel, but depending on what version of Sphinx you are using you may need to update/remove a couple of settings in that config file.   Move that file to where sphinx installs on your distro.
You will have to add the indexer commands to your cron job, samples are provided in the admin interface. 
Use SphinxQL as the search engine since that does not require the separate sphinxAPI.php file that you must get from the sphinx distro.  Any questions about all of this just ask, I'm currently running v2.2 fwiw.

Also ElkArte still defaults to myisam, you may consider converting those to innodb given the potential demands on your site.


Re: Been a while....

Reply #6

Thanks for the advice @Spuds.

Forgot to mention - I'll be dropping apache and lighty, and go straight to nginx. Im not too bothered about serving static files through a separate server, as I'll be using Cloudflare's caching.

Although I've been with SMF and its former YaBB SE since the beginning -  I cant help but get excited, and be nervous at the same time :)




Re: Been a while....

Reply #7

+1 for Nginx, been using it for several years and would never go back, faster, and so much easier to configure (IMO).   Be sure to configure it with php-fpm for best performance as well.

Also I feel you should not enable compression in ElkArte and just use the web servers gzip: on  in your nginx config.  Whats nice about this is you can tune for performance, both gzip level as well as "don't bother" for small files (overhead vs benefit) etc .. Turning if off in Elkarte (which is just php's output buffer) prevents any "double" gzipping.  Be sure to get all the application types zipped, xml, json, css, javascript etc etc. (html is implied by default).

Anyway have fun with the project  :D

Re: Been a while....

Reply #8

I'm only adding what I use:
Nginx 1.10.0
PHP 5.6.22 with OpCache
Memcached
MariaDB 10.1.15
HTTPS using Let's Encrypt.
HTTP/2
Debian 8
On a VPS with 512MB RAM and 1 vCPU.

Edit:

Thanks @Spuds ! Looks like I forgot to disable gzip in ElkArte itself.
Last Edit: July 02, 2016, 08:05:21 pm by kucing
192.MY.ID: Forum ISP Indonesia.

Re: Been a while....

Reply #9

Welcome to Elkarte, good to see people with big boards interested in elkarte

Quote from: Tony Reid – Haven't noticed any issues with 7 - but have noticed a little speed increase.
I did noticed that mentions are not playing fine with php7, I also report that in a topic iirc... so switched back to 5.6 and is running fine
sorry for my bad english

Re: Been a while....

Reply #10

Quote from: Tony Reid – Although I've been with SMF and its former YaBB SE since the beginning -  I cant help but get excited, and be nervous at the same time :)
Hi an welcome,..  the current importer needs some fixes regarding old attachments, especially those from SMF 1.1 and probably YaBBSE..
This is the  modified code for importing attachments and avatars  I used to import Ruth's Puppenstube (was an SMF 1.1 before).
Just replace the related code in smf2_importer.xml

Code: (smf2_importer.xml) [Select]
<step>
<title>Importing attachments</title>
<detect>{$from_prefix}attachments</detect>
<destination>{$to_prefix}attachments</destination>
<presql>TRUNCATE {$to_prefix}attachments;</presql>
<preparsecode>
$request = $db->query("
SELECT value
FROM {$from_prefix}settings
WHERE variable='attachmentUploadDir';");
list ($smf_attachments_dir) = $db->fetch_row($request);

$smf_attachments_dir =  rtrim($smf_attachments_dir, '/');

if (empty($row['file_hash']))
{
$row['file_hash'] = createAttachmentFileHash($row['filename']);
$clean_name = $row['filename'];
$se = array("ä", "ö", "ü", "Ä", "Ö", "Ü", "ß");
$repl = array("a", "o", "u", "A", "O", "U", "ss");
$clean_name = str_replace($se, $repl, $clean_name);
$clean_name = strtr($clean_name, 'ŠŽšžŸÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ', 'SZszYAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
$clean_name = strtr($clean_name, array('Þ' => 'TH', 'þ' => 'th', 'Ð' => 'DH', 'ð' => 'dh', 'ß' => 'ss', 'Œ' => 'OE', 'œ' => 'oe', 'Æ' => 'AE', 'æ' => 'ae', 'µ' => 'u'));
$clean_name = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $clean_name);
$enc_name = $row['id_attach'] . '_' . strtr($clean_name, '.', '_') . md5($clean_name);
$clean_name = preg_replace('~\.[\.]+~', '.', $clean_name);
$clean_name = str_replace('.', '_', $clean_name);

copy_file($smf_attachments_dir . '/' . $enc_name, $attachmentUploadDir . '/'. $row['id_attach'] . '_' . $row['file_hash'] . '.elk');
copy_file($smf_attachments_dir . '/' . $clean_name, $attachmentUploadDir . '/' . $row['id_attach'] . '_' . $row['file_hash'] . '.elk');
}
else
copy_file($smf_attachments_dir . '/' . $row['id_attach'] . '_' . $row['file_hash'], $attachmentUploadDir . '/'. $row['id_attach'] . '_' . $row['file_hash'] . '.elk');
</preparsecode>
<query>
SELECT
id_attach, id_thumb, id_msg, id_member, attachment_type, filename, file_hash, size, downloads,
width, height, fileext, mime_type, id_folder
FROM {$from_prefix}attachments
WHERE id_msg != 0;
</query>
</step>
<step>
<title>Importing avatars</title>
<detect>{$from_prefix}attachments</detect>
<destination>{$to_prefix}attachments</destination>
<options>
<replace>true</replace>
</options>
<preparsecode>
// Try custom_avatar_dir first
$request = $db->query("
SELECT value
FROM {$from_prefix}settings
WHERE variable = 'custom_avatar_dir';");
list ($smf_attachments_dir) = $db->fetch_row($request);

if (empty($smf_attachments_dir))
{
$request = $db->query("
SELECT value
FROM {$from_prefix}settings
WHERE variable='attachmentUploadDir';");
list ($smf_attachments_dir) = $db->fetch_row($request);
}

if ($avatarUploadDir == $attachmentUploadDir)
$row['attachment_type'] = 0;

if (empty($row['file_hash']))
{
$row['file_hash'] = createAttachmentFileHash($row['filename']);
$clean_name = $row['filename'];
$se = array("ä", "ö", "ü", "Ä", "Ö", "Ü", "ß");
$repl = array("a", "o", "u", "A", "O", "U", "ss");
$clean_name = str_replace($se, $repl, $clean_name);
$clean_name = strtr($clean_name, 'ŠŽšžŸÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ', 'SZszYAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
$clean_name = strtr($clean_name, array('Þ' => 'TH', 'þ' => 'th', 'Ð' => 'DH', 'ð' => 'dh', 'ß' => 'ss', 'Œ' => 'OE', 'œ' => 'oe', 'Æ' => 'AE', 'æ' => 'ae', 'µ' => 'u'));
$clean_name = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $clean_name);
$enc_name = $row['id_attach'] . '_' . strtr($clean_name, '.', '_') . md5($clean_name);
$clean_name = preg_replace('~\.[\.]+~', '.', $clean_name);

if(file_exists($smf_attachments_dir . '/' . $row['id_attach'] . '_' . str_replace('.', '_', $clean_name). md5($row['filename'] )))
copy_file($smf_attachments_dir . '/' . $row['id_attach'] . '_' . str_replace('.', '_', $clean_name) . md5($row['filename']), $avatarUploadDir . '/'. $row['id_attach'] . '_' . $row['file_hash'] . '.elk');

copy_file($smf_attachments_dir . '/' . $clean_name, $avatarUploadDir . '/' . $row['id_attach'] . '_' . $row['file_hash'] . '.elk');
}
else
copy_file($smf_attachments_dir . '/' . $row['id_attach'] . '_' . $row['file_hash'], $avatarUploadDir . '/'. $row['id_attach'] . '_' . $row['file_hash'] . '.elk');
</preparsecode>
<query>
SELECT
id_attach, id_thumb, id_msg, id_member, attachment_type, filename, file_hash, size, downloads,
width, height, fileext, mime_type, id_folder
FROM {$from_prefix}attachments
WHERE id_member != 0;
</query>
</step>
Thorsten "TE" Eurich
------------------------

Re: Been a while....

Reply #11

 emanuele feels like code should be in the repo if needed, so everybody know where to get it. O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: Been a while....

Reply #12

Its been tracked ... can't create PR's ATM !

Re: Been a while....

Reply #13

I didn't create a PR because I'm not sure if this code works only for conversions coming from pre-2.0 or it always works. O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: Been a while....

Reply #14

Thanks Thorsten! :)