• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 SMF 2.0 import can't find avatars directory

And so, I finally bought the forum.

I did a fresh install of my server on my pc with wamp, and had my website and SMF running. After I extracted the xenforo files to a xenforo folder and ran the installer. The installer finished ok, and with the forum still empty I tried running the SMF 2.0 importer.

When the importer asks for the avatars directory, I simply cannot find anything that works. Sometimes it gives this error:

The avatars directory could not be found.

And other times simply does nothing. I already tried, alongside leaving the field empty, the following:

http://localhost/forum/avatars <--- this is what is configured on smf as avatar url
C:\wamp\www\forum\avatars <--- this is what is configured on smf as avatar directory

I don't really understand what is the importer expecting to recieve.

Thank you for the help.
Last edited:

Jake Bunce

XenForo moderator
Staff member
When in doubt I always use a full server path.

Visit admin.php?tools/phpinfo and search the page for "DOCUMENT_ROOT". That will reveal the full server path to your XenForo web directory. From there you can construct a full server path to your SMF avatars.
Thank you for the quick awnser.

That gives C:/wamp/www/ as the document root, and as such what I said on the 1st post should have worked?

edit: looking at your code:

        if (!empty($config['avatarPath']))
            if (!file_exists($config['avatarPath']) || !is_dir($config['avatarPath']))
                $errors[] = new XenForo_Phrase('avatars_directory_not_found');
I assume it is simply looking for a folder, and so the situations when nothing happens should be the ones it should be able to continue?
Last edited:
Also doesn't work :/

What this seems to me is that it stays on the same page and does nothing when the directory actually exists, and gives the error when it doesn't.


Just noticed something:

What above filepaths? Am I missing something here?
Last edited:

Chris D

XenForo developer
Staff member
I can't really help you on the PHP BB front, however with regards to the attachment paths, there may be a bug here which should be fixable.

The attachment paths are established with this query, and they should be displayed back to you:

SELECT value
FROM smf_settings
WHERE variable = 'attachmentUploadDir'
Could you run that on your SMF database (you may need to change the table prefix from smf_ to whatever you have it set to) and let me know the exact output?
Showing rows 0 - 0 (1 total, Query took 0.0000 sec)

And the value is empty.

The phpbb would be just a workaround, it would be better to get it working directly to xenforo :)

edit: on the live site it actually returns the expected:


edit2: want me to try to reimport the database again?

edit3: ok, fixed that entry and reconfigured the attachements on the forum. Now the converter seems to be working. Will give further feedback after.

Thank you for the help :)
Last edited:

Chris D

XenForo developer
Staff member
What is the exact SMF version you are importing from? It's very odd that there isn't anything coming back from that query.

However we can account for that possibility in the code.

If you're comfortable editing a PHP file, open: library/XenForo/Importer/SMF.php

'attachPaths' => $path ? $path : array(),
Replace with:
'attachPaths' => $path ? $path : array(0 => ''),
That should, if it can't work out what your attachment path is by looking at the SMF database, present you with a textbox to enter that.

So my expectation with SMF attachment and avatar directories are:
  1. There is a default avatar path that contains "gallery" avatars. This is the directory where the default avatars like Bruce Willis and Cameron Diaz are... :confused: XenForo doesn't actually do anything with this. Any avatar in this directory is basically ignored, so when we ask for an avatar directory we don't care about this.
  2. It should be possible somewhere in SMF to define an attachment directory and that is where user's attachments are uploaded to.
  3. It should also be possible to define where custom avatars are uploaded to. The choices for this are either to use the same directory where attachments are uploaded or some other custom directory.
So, when you get to this step, first of all, the Attachment directory path needs to be a path to where your custom attachments are stored. Second, the avatar directory path either needs to be blank (if you store your avatars in the attachment directory) or a path to your custom avatar directory.
Maybe you didn't see the edits from the last posts but already fixed it. The problem was really from our smf install which is completly screwed up at this point, its surprising it even works.

The avatars were lost but probably because I gave the gallery avatars directory and not the other one. Il try finishing the import and give further feedback after.
Ok, the import went mostly fine. What was lost were the avatars (not a big deal, just ~200 to input manually) and members assigned to each group. Every member appears as a normal member. This also is easily done manually, our staff has ~10 members and everyone else is in groups based on post count.