Is it possible to migrate data from MySQL to PostgreSQL through Django dumpdata?












1














I'm trying to convert my database from MySQL to PostgreSQL, and I'm using AWS RDS. I was trying AWS DMS to migrate data, however it didn't work well and was complicated.



While struggling with that, an idea came to mind. What if I use migrate migrations to the new PostgreSQL, and dumpdata from MySQL and loaddata to PostgreSQL? Would that work? Does anyone have experience to migrate database? Am I approaching a right direction?










share|improve this question






















  • It should work. The data is dumped in an agnostic json format. I do recall small little issues arising auto-incremented fields but your specific problems will surface when you try it out.
    – Victor 'Chris' Cabral
    Nov 20 at 19:54
















1














I'm trying to convert my database from MySQL to PostgreSQL, and I'm using AWS RDS. I was trying AWS DMS to migrate data, however it didn't work well and was complicated.



While struggling with that, an idea came to mind. What if I use migrate migrations to the new PostgreSQL, and dumpdata from MySQL and loaddata to PostgreSQL? Would that work? Does anyone have experience to migrate database? Am I approaching a right direction?










share|improve this question






















  • It should work. The data is dumped in an agnostic json format. I do recall small little issues arising auto-incremented fields but your specific problems will surface when you try it out.
    – Victor 'Chris' Cabral
    Nov 20 at 19:54














1












1








1







I'm trying to convert my database from MySQL to PostgreSQL, and I'm using AWS RDS. I was trying AWS DMS to migrate data, however it didn't work well and was complicated.



While struggling with that, an idea came to mind. What if I use migrate migrations to the new PostgreSQL, and dumpdata from MySQL and loaddata to PostgreSQL? Would that work? Does anyone have experience to migrate database? Am I approaching a right direction?










share|improve this question













I'm trying to convert my database from MySQL to PostgreSQL, and I'm using AWS RDS. I was trying AWS DMS to migrate data, however it didn't work well and was complicated.



While struggling with that, an idea came to mind. What if I use migrate migrations to the new PostgreSQL, and dumpdata from MySQL and loaddata to PostgreSQL? Would that work? Does anyone have experience to migrate database? Am I approaching a right direction?







django django-migrations






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 at 19:01









Jay

423111




423111












  • It should work. The data is dumped in an agnostic json format. I do recall small little issues arising auto-incremented fields but your specific problems will surface when you try it out.
    – Victor 'Chris' Cabral
    Nov 20 at 19:54


















  • It should work. The data is dumped in an agnostic json format. I do recall small little issues arising auto-incremented fields but your specific problems will surface when you try it out.
    – Victor 'Chris' Cabral
    Nov 20 at 19:54
















It should work. The data is dumped in an agnostic json format. I do recall small little issues arising auto-incremented fields but your specific problems will surface when you try it out.
– Victor 'Chris' Cabral
Nov 20 at 19:54




It should work. The data is dumped in an agnostic json format. I do recall small little issues arising auto-incremented fields but your specific problems will surface when you try it out.
– Victor 'Chris' Cabral
Nov 20 at 19:54












1 Answer
1






active

oldest

votes


















1














I've done this in the past and it has worked, but with some bumps in the road. Be sure your database is frozen - you might want to put users with access into read-only mode.



Good luck.






share|improve this answer





















  • Do you remember what kind of bumps you had? I just finished manage.py loaddata and it seems to be working very well for now. Like you advised, I'm gonna freeze MySQL database for a while, and then delete it when I'm sure everything is okay.
    – Jay
    Nov 20 at 23:16










  • The issues I ran into were with JSON in columns from the Wagtail CMS. Getting the keys within the JSON blocks made things tricky!
    – FlipperPA
    Nov 21 at 16:44










  • That CMS library looks great. I should try it later :) So, it sounds like it would be okay if not using Wagtail CMS?
    – Jay
    Nov 21 at 17:18










  • As long as you're not doing anything too exotic with JSON in fields, I haven't run into any other problems. I'd take a wait-and-see approach - hang on to the old database for a while to make sure all is okay. In fact, do a mysqldump and gzip the backup to keep it, even after you shut it down. I've moved to PostgreSQL everywhere and have been very happy with it!
    – FlipperPA
    Nov 22 at 2:43










  • Alright, thank you for the advise. Will keep the old db for a while as you advised that. Thanks!
    – Jay
    Nov 22 at 8:50











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399818%2fis-it-possible-to-migrate-data-from-mysql-to-postgresql-through-django-dumpdata%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I've done this in the past and it has worked, but with some bumps in the road. Be sure your database is frozen - you might want to put users with access into read-only mode.



Good luck.






share|improve this answer





















  • Do you remember what kind of bumps you had? I just finished manage.py loaddata and it seems to be working very well for now. Like you advised, I'm gonna freeze MySQL database for a while, and then delete it when I'm sure everything is okay.
    – Jay
    Nov 20 at 23:16










  • The issues I ran into were with JSON in columns from the Wagtail CMS. Getting the keys within the JSON blocks made things tricky!
    – FlipperPA
    Nov 21 at 16:44










  • That CMS library looks great. I should try it later :) So, it sounds like it would be okay if not using Wagtail CMS?
    – Jay
    Nov 21 at 17:18










  • As long as you're not doing anything too exotic with JSON in fields, I haven't run into any other problems. I'd take a wait-and-see approach - hang on to the old database for a while to make sure all is okay. In fact, do a mysqldump and gzip the backup to keep it, even after you shut it down. I've moved to PostgreSQL everywhere and have been very happy with it!
    – FlipperPA
    Nov 22 at 2:43










  • Alright, thank you for the advise. Will keep the old db for a while as you advised that. Thanks!
    – Jay
    Nov 22 at 8:50
















1














I've done this in the past and it has worked, but with some bumps in the road. Be sure your database is frozen - you might want to put users with access into read-only mode.



Good luck.






share|improve this answer





















  • Do you remember what kind of bumps you had? I just finished manage.py loaddata and it seems to be working very well for now. Like you advised, I'm gonna freeze MySQL database for a while, and then delete it when I'm sure everything is okay.
    – Jay
    Nov 20 at 23:16










  • The issues I ran into were with JSON in columns from the Wagtail CMS. Getting the keys within the JSON blocks made things tricky!
    – FlipperPA
    Nov 21 at 16:44










  • That CMS library looks great. I should try it later :) So, it sounds like it would be okay if not using Wagtail CMS?
    – Jay
    Nov 21 at 17:18










  • As long as you're not doing anything too exotic with JSON in fields, I haven't run into any other problems. I'd take a wait-and-see approach - hang on to the old database for a while to make sure all is okay. In fact, do a mysqldump and gzip the backup to keep it, even after you shut it down. I've moved to PostgreSQL everywhere and have been very happy with it!
    – FlipperPA
    Nov 22 at 2:43










  • Alright, thank you for the advise. Will keep the old db for a while as you advised that. Thanks!
    – Jay
    Nov 22 at 8:50














1












1








1






I've done this in the past and it has worked, but with some bumps in the road. Be sure your database is frozen - you might want to put users with access into read-only mode.



Good luck.






share|improve this answer












I've done this in the past and it has worked, but with some bumps in the road. Be sure your database is frozen - you might want to put users with access into read-only mode.



Good luck.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 20 at 20:04









FlipperPA

6,85322043




6,85322043












  • Do you remember what kind of bumps you had? I just finished manage.py loaddata and it seems to be working very well for now. Like you advised, I'm gonna freeze MySQL database for a while, and then delete it when I'm sure everything is okay.
    – Jay
    Nov 20 at 23:16










  • The issues I ran into were with JSON in columns from the Wagtail CMS. Getting the keys within the JSON blocks made things tricky!
    – FlipperPA
    Nov 21 at 16:44










  • That CMS library looks great. I should try it later :) So, it sounds like it would be okay if not using Wagtail CMS?
    – Jay
    Nov 21 at 17:18










  • As long as you're not doing anything too exotic with JSON in fields, I haven't run into any other problems. I'd take a wait-and-see approach - hang on to the old database for a while to make sure all is okay. In fact, do a mysqldump and gzip the backup to keep it, even after you shut it down. I've moved to PostgreSQL everywhere and have been very happy with it!
    – FlipperPA
    Nov 22 at 2:43










  • Alright, thank you for the advise. Will keep the old db for a while as you advised that. Thanks!
    – Jay
    Nov 22 at 8:50


















  • Do you remember what kind of bumps you had? I just finished manage.py loaddata and it seems to be working very well for now. Like you advised, I'm gonna freeze MySQL database for a while, and then delete it when I'm sure everything is okay.
    – Jay
    Nov 20 at 23:16










  • The issues I ran into were with JSON in columns from the Wagtail CMS. Getting the keys within the JSON blocks made things tricky!
    – FlipperPA
    Nov 21 at 16:44










  • That CMS library looks great. I should try it later :) So, it sounds like it would be okay if not using Wagtail CMS?
    – Jay
    Nov 21 at 17:18










  • As long as you're not doing anything too exotic with JSON in fields, I haven't run into any other problems. I'd take a wait-and-see approach - hang on to the old database for a while to make sure all is okay. In fact, do a mysqldump and gzip the backup to keep it, even after you shut it down. I've moved to PostgreSQL everywhere and have been very happy with it!
    – FlipperPA
    Nov 22 at 2:43










  • Alright, thank you for the advise. Will keep the old db for a while as you advised that. Thanks!
    – Jay
    Nov 22 at 8:50
















Do you remember what kind of bumps you had? I just finished manage.py loaddata and it seems to be working very well for now. Like you advised, I'm gonna freeze MySQL database for a while, and then delete it when I'm sure everything is okay.
– Jay
Nov 20 at 23:16




Do you remember what kind of bumps you had? I just finished manage.py loaddata and it seems to be working very well for now. Like you advised, I'm gonna freeze MySQL database for a while, and then delete it when I'm sure everything is okay.
– Jay
Nov 20 at 23:16












The issues I ran into were with JSON in columns from the Wagtail CMS. Getting the keys within the JSON blocks made things tricky!
– FlipperPA
Nov 21 at 16:44




The issues I ran into were with JSON in columns from the Wagtail CMS. Getting the keys within the JSON blocks made things tricky!
– FlipperPA
Nov 21 at 16:44












That CMS library looks great. I should try it later :) So, it sounds like it would be okay if not using Wagtail CMS?
– Jay
Nov 21 at 17:18




That CMS library looks great. I should try it later :) So, it sounds like it would be okay if not using Wagtail CMS?
– Jay
Nov 21 at 17:18












As long as you're not doing anything too exotic with JSON in fields, I haven't run into any other problems. I'd take a wait-and-see approach - hang on to the old database for a while to make sure all is okay. In fact, do a mysqldump and gzip the backup to keep it, even after you shut it down. I've moved to PostgreSQL everywhere and have been very happy with it!
– FlipperPA
Nov 22 at 2:43




As long as you're not doing anything too exotic with JSON in fields, I haven't run into any other problems. I'd take a wait-and-see approach - hang on to the old database for a while to make sure all is okay. In fact, do a mysqldump and gzip the backup to keep it, even after you shut it down. I've moved to PostgreSQL everywhere and have been very happy with it!
– FlipperPA
Nov 22 at 2:43












Alright, thank you for the advise. Will keep the old db for a while as you advised that. Thanks!
– Jay
Nov 22 at 8:50




Alright, thank you for the advise. Will keep the old db for a while as you advised that. Thanks!
– Jay
Nov 22 at 8:50


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399818%2fis-it-possible-to-migrate-data-from-mysql-to-postgresql-through-django-dumpdata%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen