Database migration issue. The process stopped at Step 3 the Deploy Migration Service

I tried to migrate my railway database but it returned an error at step three without showing any log info
43 Replies
Percy
Percy5mo ago
Project ID: 98888b3e-8302-4a34-a31a-6ba9963dccee
CodeLover
CodeLover5mo ago
Project id : 98888b3e-8302-4a34-a31a-6ba9963dccee
Brody
Brody5mo ago
hey is the migration still stuck?
CodeLover
CodeLover5mo ago
It failed. I tried three times but it now fails At step 4: Migrate Data However, a New MySQL database was created, but I can't tell if it has all the data from the Legacy DB
Brody
Brody5mo ago
can you check the logs of the migration service for any errors?
CodeLover
CodeLover5mo ago
Yes. I've just checked and it shows an error: [ ERROR ] The new database is not empty. Aborting migration. auth_group_permissions Set the OVERWRITE_DATABASE environment variable to overwrite the new database.
Brody
Brody5mo ago
set that variable
CodeLover
CodeLover5mo ago
To True?
Brody
Brody5mo ago
any value should work
CodeLover
CodeLover5mo ago
OK. Thanks, man. I'll try it now. I've tried it, but it didn't work
Brody
Brody5mo ago
what do the logs say now
CodeLover
CodeLover5mo ago
[ ERROR ] The new database is not empty. Aborting migration. auth_permission django_admin_log django_celery_results_chordcounter Set the OVERWRITE_DATABASE environment variable to overwrite the new database.
Brody
Brody5mo ago
have you set that variable?
CodeLover
CodeLover5mo ago
Yes, I've set the OVERWRITE_DATABASE to True
Brody
Brody5mo ago
the migration service thinks otherwise can you send me a screenshot of the project so i know where we are at?
CodeLover
CodeLover5mo ago
Yes, sure
CodeLover
CodeLover5mo ago
Here
No description
Brody
Brody5mo ago
thats a lot of red
CodeLover
CodeLover5mo ago
Yes, I tried three times and it failed tree times
Brody
Brody5mo ago
delete everything highlighted
No description
Brody
Brody5mo ago
and delete any stray volumes as a result
CodeLover
CodeLover5mo ago
OK. Got it OK. It's done
Brody
Brody5mo ago
new screenshot please
CodeLover
CodeLover5mo ago
Here it is
No description
Brody
Brody5mo ago
rename your mysql database to just MySQL
CodeLover
CodeLover5mo ago
OK. I dit it
Brody
Brody5mo ago
would you happen to know how much data you have in your mysql database? would it be over 5gb?
CodeLover
CodeLover5mo ago
No, I don't. But I am quite sure it is less than 1 gb
Brody
Brody5mo ago
sounds good does that school-manager service use variable references?
CodeLover
CodeLover5mo ago
No, I hard-coded the url
Brody
Brody5mo ago
please use reference variables before we run another migration https://docs.railway.app/guides/variables#referencing-another-services-variable
CodeLover
CodeLover5mo ago
OK.
Brody
Brody5mo ago
let me know when done!
CodeLover
CodeLover5mo ago
It's done now
Brody
Brody5mo ago
can you show me how you have used reference variables?
CodeLover
CodeLover5mo ago
here
No description
Brody
Brody5mo ago
cool, re-run the migration now
CodeLover
CodeLover5mo ago
OK It worked!! Thank you very much @Brody
Brody
Brody5mo ago
no problem!
CodeLover
CodeLover5mo ago
By the way, is it possible to check the current db size?
Brody
Brody5mo ago
CodeLover
CodeLover5mo ago
OK. A 1000 thanks
Brody
Brody5mo ago
happy to help!