Ask Your Question

OSError when trying to import StackExchange dump

asked 2012-11-09 06:22:38 -0500

mornaner gravatar image

updated 2012-11-14 18:52:01 -0500

Evgeny gravatar image

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...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-11-10 15:48:35 -0500

Evgeny gravatar image

updated 2012-11-10 15:50:30 -0500

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).

edit flag offensive delete link more


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

mornaner gravatar imagemornaner ( 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 gravatar imageEvgeny ( 2012-11-13 20:58:17 -0500 )edit

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

Evgeny gravatar imageEvgeny ( 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 gravatar imagemornaner ( 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 gravatar imageAndy ( 2016-01-28 03:00:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-11-09 06:22:38 -0500

Seen: 401 times

Last updated: Jan 28 '16