First time here? Check out the FAQ!

OSError when trying to import StackExchange dump

We are migrating our SE 1.0 site to AskBot. I've installed askbot successfully. If I try to import the dump on a web browser I get this:

OSError at /import-data/
[Errno 2] No such file or directory: '/var/www/my-site/tmp/tmpQ011U4.upload'


  135.         self.file = TemporaryUploadedFile(self.file_name, self.content_type, 0, self.charset)
File "/usr/local/lib/python2.7/dist-packages/django/core/files/" in __init__
  64.                 dir=settings.FILE_UPLOAD_TEMP_DIR)
File "/usr/lib/python2.7/" in NamedTemporaryFile
  454.     (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
File "/usr/lib/python2.7/" in _mkstemp_inner
  235.             fd =, flags, 0600)

Exception Type: OSError at /import-data/
Exception Value: [Errno 2] No such file or directory: '/var/www/my-site/tmp/tmpnyH5zD.upload'

If I try to import it via the console I get the following error:

cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/", line 34, in execute
return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/", line 44, in execute
    return self.cursor.execute(query, args)
django.db.utils.DatabaseError: relation "stackexchange_votetype" does not exist
LINE 1: SELECT (1) AS "a" FROM "stackexchange_votetype" WHERE "stack...
mornaner's avatar
asked 2012-11-09 06:22:38 -0500
Evgeny's avatar
updated 2012-11-14 18:52:01 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


Sorry for the delay. I think in this case you forgot to run syncdb and maybe forgot to add 'askbot.importers.stackexchange' to the INSTALLED_APPS setting in the file.

Please give more information if you have further issues, we have not recently tested the SE imports (but I will over this weekend).

The UI import may be failing you due to some file system issues (existence of directories/permissions).

Evgeny's avatar
answered 2012-11-10 15:48:35 -0500, updated 2012-11-10 15:50:30 -0500
edit flag offensive 0 remove flag delete link


I added the line on by hand but had a typo... Thanks for the help.

mornaner's avatar mornaner (2012-11-12 03:36:13 -0500) edit

Made some fixes and now seem to be able to import a large file ~5000 questions. Works quite slowly, I will add some more logging statements tomorrow so that you can monitor the progress. If you need further optimizations - please let me know.

Evgeny's avatar Evgeny (2012-11-13 20:58:17 -0500) edit

I've updated the command with some more meaningful progress statements.

Evgeny's avatar Evgeny (2012-11-14 18:53:41 -0500) edit

@Evgeny Thanks for the updates, I've tried to import again and got another error. Do you prefer me to open another question or to ask it here?

mornaner's avatar mornaner (2012-11-17 04:36:32 -0500) edit

SE download filetype has changed to *.7z.It can't be down.Does askbot support *.7z filetpye to import?? what can I do??

Andy's avatar Andy (2016-01-28 03:00:11 -0500) edit
add a comment see more comments