How do I move a project from one computer to another?

34 views
Skip to first unread message

Tom Tanner

unread,
Feb 12, 2018, 7:09:50 PM2/12/18
to Django users
I have a Django project that I want to work on with another computer. Do I need to backup my current project's Postgres database and restore it on the other computer's Postgres database to get my project up and running there? Or is there a Django way to do this?

Etienne Robillard

unread,
Feb 12, 2018, 7:26:49 PM2/12/18
to Tom Tanner, django...@googlegroups.com

Hi,

you can use rsync for your project's source code.

Etienne


Le 2018-02-12 à 19:09, Tom Tanner a écrit :
I have a Django project that I want to work on with another computer. Do I need to backup my current project's Postgres database and restore it on the other computer's Postgres database to get my project up and running there? Or is there a Django way to do this?
--
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 django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
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/b5ab2022-4fd1-4f8f-bb40-d4194bbf397f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Etienne Robillard
tka...@yandex.com
https://www.isotopesoftware.ca/

sum abiut

unread,
Feb 12, 2018, 7:57:53 PM2/12/18
to django...@googlegroups.com
It depends on where you want to house your app.if you need to house your app on the new machine. Just pip install from your requirements.txt file, then copy your django project to your new machine.

On 13/02/2018 11:10 AM, "Tom Tanner" <dontsende...@gmail.com> wrote:
I have a Django project that I want to work on with another computer. Do I need to backup my current project's Postgres database and restore it on the other computer's Postgres database to get my project up and running there? Or is there a Django way to do this?

--
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 django-users+unsubscribe@googlegroups.com.

Ramez Kabbani

unread,
Feb 12, 2018, 9:20:17 PM2/12/18
to Django users
You should  be using some kind of git system. Push your code to the repo and pull it on the new machine. There should be no really concern switching machines.
If your current DB has data that you need, export them and then import.

You need to know how to do this for production code, so you might as well learn now.

Mike Dewhirst

unread,
Feb 12, 2018, 10:18:34 PM2/12/18
to Django users
There are at least two simple ways to do this. Both need a repo to keep
your source code and requirements file (eg freeze.txt) in sync between
your machines. Both need to run pip -r freeze.txt each time it changes.

1. Dump the "master" database into a text file, copy it to the "slave"
machine and load it there. Obviously you can do this in both directions.
You can use bash scripts or Windows batch files. Risk of human error in
overwriting the wrong database is a constant possibility.

2. Establish your current Postgres as a more widely accessible server
which can be seen from the slave machine. A bonus here is that
migrations can be done from either machine and the database can never
get out of sync. Every database dump is a backup if you include a date
in the filename. And it can be dumped from either machine.

In both cases you will need to manage database credentials using
identical source code in your settings. This is because after you merge
your source from machine to machine in either direction the Django
settings need to see the database. But that's a separate question.

hth

Mike




> --
> 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 django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/d/msgid/django-users/b5ab2022-4fd1-4f8f-bb40-d4194bbf397f%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages