Django Dumpdata Error Unable To Serialize Database

Ah – another problem. The dumpdata command, with no apps supplied, dumps everything including Users, User profiles, Sites, etc. Your dev database, even if you only just set it up a second ago, will have some content already. So you will get error messages like this: IntegrityError: Could not load myapp. Django dumpdata Unable to serialize database: Could not decode to UTF-8 column. Anonymous; 2017/11/18. Share on Facebook Share on Twitter. I have a sqlite db which I want to dump. I use the command: $ python manage.py dumpdata >dump.json. But I get the following error: CommandError: Unable to serialize.

Django Dumpdata Error Unable To Serialize Database

Here is the traceback details. Thank you for the additional information. I guess you are using SQL Server ODBC Driver (sqlsrv32.dll) for your database driver and that's why you receive the error.

Driver For Hp Scanjet 5370c Windows 7. Django serializer needs to receive DateField values as date type, but in your case SQL Server converts the value from date to varchar type automatically because the driver doesn't understand the date type. Download Free Pokemon Gameboy Color Hacking Tools. SQL Server ODBC Driver is basically for old versions of SQL Server and is obsolete to work with new versions of SQL Server. If you want to make use of new features, for example new data types like date, you have to use the appropriate version of SQL Server Native Client instead.

If you want to know more about the difference between SQL Server ODBC Driver and SQL Server Native Client, see this: Anyway, I think a quick and reliable solution for your problem is just to install SQL Server Native Client (or more recent Microsoft ODBC Driver 11 for SQL Server) on your computer and specify the driver name as driver option in your DATABASE settings. Of course, I did test a few things to reproduce the error: I habe a field like birthday = models.DateField(blank=True, null=True). On my dev machine with sqlite everything is ok.

On my test and prod machines, both with SQLServer I can reproduce the error by setting a date. Avanquest Mobile Phone Tools Serial Number. If I remove all dates from the model (so every entry is NULL), the dump works. The data type on the SQLServer-side is date. SQLServer-Version ist SELECT @@VERSION Microsoft SQL Server 2008 R2 (SP3) -.34 (X64) Aug 19 2014 12:21:34 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1). Thank you for the details. The data type on the SQLServer-side is date.

That's why dumpdata fails on your Linux machine. FreeTDS supports TDS protocol versions up to 7.2 and can't handle date type, and SQL Server converts a date value to a varchar value automatically when you retrieve it via FreeTDS. See this for the differences between TDS protocol versions: But I wonder why the date type is assigned to the DateField because the backend usually assigns the legacy datetime type to a DateField when you run migrations using FreeTDS. Did you perhaps apply migrations from a Windows machine?

OK, I see the issue. As far as I remember I did start the project using django-pyodbc and switched to django-pyodbc-azure because I couldn't make it work with Django 1.7.

So I assume django-pyodbc created the date-field and since I didn't need the dumpdata until now I did not notice it. My freetds/unixODBC config is configured for protocol version 8.0. As your link says, that means it is using version 7.1. Since we have SQLServer 2008 I tried switching to 7.3, but now I get an error on every SQL-request ('42000', '[42000] [FreeTDS][SQL Server]Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (4004) (SQLExecDirectW)').:-/ How do I solve this? Maybe changing the date-field to datetime manually in SQL Management Studio?