0

So I used to have my Django Project named "TestProject". Recently I started taking it more serious and renamed it to "ParadoxSite" (the name of the application).
Now I am wondering how I can transfer all data stored in db.sqlite3 to this new project without dataloss.
Maybe its possible to just run the migration flow, but I couldn't confirm this anywhere so didn't want to run the risk.

kipteam
  • 84
  • 10
  • can't you just copy+paste `db.sqlite3`? if the only thing you've changed is projects name, and all models stay the same it may work – oruchkin Aug 12 '22 at 07:26
  • @oruchkin no as it will give an error "django.db.utils.OperationalError: no such table: ParadoxSite_profile" – kipteam Aug 12 '22 at 07:29
  • Have you changed database name in `settings.py` ? – antpngl92 Aug 12 '22 at 07:31
  • @antpngl92 I did not change it. – kipteam Aug 12 '22 at 07:38
  • 2
    @kipteam you need to manually rename all tables in your db from `TestProject_TABLENAME` to `ParadoxSite_TABLENAME`, download sqlitedbrowser to better understanding what is inside of this db https://sqlitebrowser.org/ , you have about 10 default databases which you need to rename – oruchkin Aug 12 '22 at 07:39
  • The error says that there is no `Profile` model in your project. Make sure that there is one and migrations are made before feed the backup of your old DB. – antpngl92 Aug 12 '22 at 07:40
  • @antpngl92 no, this error says that he is using database from `TestProject` in `ParadoxSite` project, and database by default hase a name of project before table name. There is nothing to do with migrations here – oruchkin Aug 12 '22 at 07:42
  • @oruchkin You are right, I haven't used SQLite for a while. You get `/db.sqlite3` as a default DB name. – antpngl92 Aug 12 '22 at 07:52

0 Answers0