MGSteve
Well-known member
This is a quick guide on how to use the CLI importer with your forum. Currently its in Alpha and only for vBulletin importers.
This guide is for Linux as well, but should be easy enough to use for windows people.
You will need SSH access to your server for this. CLI means command line interface, so you need to log into your server via SSH, a great client if you haven't got one is PuTTY - just google it.
Ok, first thing - install the addon into xf, its located at <xf_install_root>/library/XFCliImporter/addon-XFCliImporter.xml
Now start your import as usual, just make sure you select the 'multithread' option when selecting where you're importing it from.
Currently the only thing that is multi-threaded is importing the threads and posts. Once you get to that step, you'll be asked a few questions

Now you need to know what your CPU is! a good way is to run
cat /proc/cpuinfo, which will output all the CPU info.
Example output.
Now, I know I've got 2 Quad core Xeons, which makes 8 cores, 16 with hyper threading. In the above grab you can see its detailing 'processor 15', as the first one is 0, that's 16 processors as far as Linux is concerned.
So, to go back to the page...

You need to click the 'Use Command Line Interface' option and then enter the path to the php library. This can be tricky as I found out - I appear to have two installs of PHP on the machine, but only one of them is used in Apache.
So, I just ran 'whereis php' and got this reply
php: /usr/bin/php /etc/php.ini /etc/php.d /usr/local/bin/php /usr/local/lib/php /usr/share/man/man1/php.1.gz
So, its found it in /usr/bin/php and /usr/local/bin/php, in addition to the ini file, the config directory and the lib directory.
So its either /usr/bin/php or /usr/local/bin/php. I ran the two commands with the -v parameter to get the version so I could compare them and it turns out /usr/local/bin/php is the right one in my case.
So put your path to php into the box.
The next question determines the number of processes to run. Ideally you want one per CPU core, so I entered 16 in there.
Now, if you have taskset on your system using this will help ensure that the processes don't bounce from core to core, taskset tells linux to run the process on a specific core and not to change it. So this also wants to be the number of cores in your system, again I set this to 16.
How do you know if you have taskset installed? Run it of course. type in taskset -v into the shell and you should see something like:
Then all you do is sit back and relax! You'll see the world tick by in the form of updates every 30 secs.
Once its completed, just click the button on the page to continue the import.
its not really that hard to use, to be honest, but I thought that it may help some people to see whats involved before they start on it.
This guide is for Linux as well, but should be easy enough to use for windows people.
You will need SSH access to your server for this. CLI means command line interface, so you need to log into your server via SSH, a great client if you haven't got one is PuTTY - just google it.
Ok, first thing - install the addon into xf, its located at <xf_install_root>/library/XFCliImporter/addon-XFCliImporter.xml
Now start your import as usual, just make sure you select the 'multithread' option when selecting where you're importing it from.
Currently the only thing that is multi-threaded is importing the threads and posts. Once you get to that step, you'll be asked a few questions

Now you need to know what your CPU is! a good way is to run
cat /proc/cpuinfo, which will output all the CPU info.
Code:
processor : 15
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 2400.145
cache size : 12288 KB
physical id : 1
siblings : 8
core id : 9
cpu cores : 4
apicid : 51
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rdtscp lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
bogomips : 4800.11
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: [8]
Now, I know I've got 2 Quad core Xeons, which makes 8 cores, 16 with hyper threading. In the above grab you can see its detailing 'processor 15', as the first one is 0, that's 16 processors as far as Linux is concerned.
So, to go back to the page...

You need to click the 'Use Command Line Interface' option and then enter the path to the php library. This can be tricky as I found out - I appear to have two installs of PHP on the machine, but only one of them is used in Apache.
So, I just ran 'whereis php' and got this reply
php: /usr/bin/php /etc/php.ini /etc/php.d /usr/local/bin/php /usr/local/lib/php /usr/share/man/man1/php.1.gz
So, its found it in /usr/bin/php and /usr/local/bin/php, in addition to the ini file, the config directory and the lib directory.
So its either /usr/bin/php or /usr/local/bin/php. I ran the two commands with the -v parameter to get the version so I could compare them and it turns out /usr/local/bin/php is the right one in my case.
So put your path to php into the box.
The next question determines the number of processes to run. Ideally you want one per CPU core, so I entered 16 in there.
Now, if you have taskset on your system using this will help ensure that the processes don't bounce from core to core, taskset tells linux to run the process on a specific core and not to change it. So this also wants to be the number of cores in your system, again I set this to 16.
How do you know if you have taskset installed? Run it of course. type in taskset -v into the shell and you should see something like:
Once you've set all that, simply click the import button. Next you'll see the command you need to paste into the shell window.taskset (util-linux 2.13-pre7)
usage: taskset [options] [mask | cpu-list] [pid | cmd [args...]]
set or get the affinity of a process
-p, --pid operate on existing given pid
-c, --cpu-list display and specify cpus in list format
-h, --help display this help
-v, --version output version information
Then all you do is sit back and relax! You'll see the world tick by in the form of updates every 30 secs.
If you get the last line repeated time and time again then the processes have probbaly stopped running. I had this initially because I was running the wrong php version. In this case you need to check the import log, located in /tmp/import.log and then your usual php error logs to find out what's gone wrong.00:08:54 Approximately 248,600 threads remaining to import.
00:09:24 Approximately 246,300 threads remaining to import.
00:09:54 Approximately 244,100 threads remaining to import.
00:10:24 Approximately 242,300 threads remaining to import.
00:10:54 Approximately 240,900 threads remaining to import.
00:11:24 Approximately 238,900 threads remaining to import.
Once its completed, just click the button on the page to continue the import.
its not really that hard to use, to be honest, but I thought that it may help some people to see whats involved before they start on it.