Depending on the SQL distribution you're using, there should be a couple
tools to do this without python using a CLI command or a basic SQL script.

If you need to do it in python, use a basic python library (again, depends
on your sql distribution) to connect to your database and execute the SQL
command to execute the file.

I only remember how to do this in postgres specifically, but you happen to
be using postgres as well, I can help further.

On Thu, Oct 11, 2018 at 5:03 AM Mohammad Shareef M <[email protected]>
wrote:

> Create new database and Restore the backup file
>
> Thanks & Regards,
> Mahammad Shareef M
>  +919741482617
>  +971501340618
>  +971581756035
>
>
> On Thu, Oct 11, 2018 at 4:01 PM Mohammad Aqib <[email protected]>
> wrote:
>
>> Hi All,
>> I have a task to migrate all data into a new database using "backup.sql"
>> file.
>> How to write a Python script to do this task.
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAOh93ncV9awh9Y6GCC72FCY4XUO2eOSBWpB-TKH_RRmOk_4vZA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAOh93ncV9awh9Y6GCC72FCY4XUO2eOSBWpB-TKH_RRmOk_4vZA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUAdBH1-wZeR3J%2BKFpFxnwQYWu3CsZxacoiPOOsv7VzqY3%2Brg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPUAdBH1-wZeR3J%2BKFpFxnwQYWu3CsZxacoiPOOsv7VzqY3%2Brg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALG8KeAXP%3DF4fzbV1PVMr0CyELHYr2pASRqZerDEt1%3DVbkX%2BSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to