We have to complete Django1.6 app from mysql database migration to PostgreSQL, if your environment is very clean, the process will be very simple, as long as the permit or migrate syncdb to create tables, the data truncating the table, and then run dumpdata and loaddatamanagement command is complete. First, create PostgreSQL database Air Jordan Outlet in your instance of an empty: CREATE DATABASE dbname OWNER rolename; the second step, the database in your Django configuration to create a plus in setting.py, we have this configuration: DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbname', 'USER': 'dbuser', 'PASSWORD': 'dbpass',' HOST ':' mysql .example.com ',' PORT ':' BHM Jordan CP3.VI Black History Month Chris Paul PE Sale ',},' postgresql ': {' ENGINE ':' django.db.backends.postgresql_psycopg2 ',' NAME ':' dbname ',' USER ':' dbuser ', 'PASSWORD': 'dbpass', 'HOST': 'postgresql.example.com', 'PORT': '',}} so we specify BHM Lebron 12 Black White-Metallic Silver the name of the operation after which the database. The Air Max 2012 Womens Navy Blue White third step is to create a table python manage.py syncdb Nike 6.0 Mavrk Mid 2 Skate Shoes Blue Grey --migrate --no-initial-data --database = postgresql run syncdb and migrations in PostgreSQL PostgreSQL instances in this process and no initial data. The fourth step, the newly created table truncate Although we specify -no-initial-data in the previous step, in order to prevent the migration of users to customize data in unknown circumstances joined the table, we'd still truncate look at the new table, we can generate a SQL script, run: python manage.py sqlflush --database = postgresql fifth step from the mysql backup data to a JSON file Django has a dumpdata command, use it to generate a database-independent backup, the default format is JSON. python manage.py dumpdata --all --natural --indent = 4 \u0026 gt; Nike Air Jordan dbname.json -all parameter here is to make sure you have the data in the export Jordan CP3 VI process may have needs of your own filter and modify data, and - natural parameter tells Django to use natural keys (if available) -indent parameter is to make output more Lebron James readable. You may want to black grey Women Nike Dunk High Heels Sale export only specific apps in the data, or export only a celery logs, so, you can use -exclude parameters, such as: python manage.py dumpdata --all --natural --exclude = djcelery - exclude = search.SearchLog --indent = 4 \u0026 gt; sixth step dbname.json, load JSON data into PostgreSQL database procedure python manage.py loaddata dbname.json --database = postgresql substantially migrated over, now you Just modify your database configuration, then PostgerSQL become the default database. DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'dbname', 'USER': 'dbuser', 'PASSWORD': 'dbpass', 'HOST': 'postgresql.example.com', 'PORT': '',}} In our case, our database is not very clean, our database is to create a PHP legacy code, New Womens Nike Free 3 V3 Trainers Black Grey and we are still one step to get rid of It is, we have some outside Django database, and are used by the program, in order to put these migrate to PostgreSQL, I use this tool, the process is simple. Note Django signals you might want to disable these, when a database record is created, your program might be sent to your e-mail used, in order not to disturb them, the data is loaded, you need to ensure that they are banned , Here's one way to handle this here we use the detector signal does not trigger the guarantee. Constraints (such as non-null, unique and foreign keys) Our database migration process encountered many of these problems, such as a foreign key constraint, but New Womens Nike Free 3 V3 Trainers Black Grey the other one table does not exist, and there are records about the vacant, but are not allowed in the model definition , such as the existence of the replication process unique constraints, which require manual intervention, I have to Air Max 2012 Womens Navy Blue White use SQL statements rid of these, Dumpdata and loaddata will detect these, so your database Nike Air Max must be a clean consistent state. This hard-coded primary key is very painful, because hard-coded in our test suite, the master key everywhere, so many tests to fail, because the use of sequence processing method and PostgreSQL mysql not the same, I have to manually modify 700 multiple test cases, mostly very simple but very time-consuming modifications. Native SQL statements Fortunately, we only have one use native sql statement in some mysql functions in PostgreSQL do not apply, we only modify the function in PostgreSQl same function on it. Case-sensitive string comparison is case sensitive in PostgreSQL, Mysql in but not in, I was Air Max 2012 Purple Black in a non-migrating data 2015 Nike Free 5.0 tables Django process also encountered some problems, when the index is created, the command requires id, but the name field is Id (letter I), I just rename the id on it.Django application database migration from MySQL to PostgreSql of