'Django migrating to new database, should I apply migrations before moving data?

My Django app uses an encrypted Amazon AWS RDS database. The encryption causes some annoyances/complexities and costs a small amount of extra money, so I'd like to do away with it.

Encryption can't be removed so I've created a new RDS instance with new database. The old database also use PostGres 12.8 whereas the new one uses 14.2.

Should I apply migrations to the new database and then move the data into the tables created by the migrations? Or can I just use a data migration service such as AWS DMS or DBeaver which will create the tables for me?

I ask because I wonder if there are any intricate differences in how migrations provision the database vs how a data migration tool might do it, causing me issues down the line.



Solution 1:[1]

Django executes normal SQL commands when applying migrations and stores data in a table to remember which migrations already applied. All needed informations are contained in the database itself, so you can directly transfer the data in the new database without applying migrations before.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RedWheelbarrow