forked from philpearl/django-dumpdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
71 lines (46 loc) · 2.06 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
I am modifying this package for use in migrating Specify data from MySQL to Postgres.
Note: The django DEBUG setting should be set to False to prevent large memory consumption
which is due, I think, to the logging of query info the db cursor objects.
So far, it has been changed to produce output suitable for loading into a established
postgres schema (e.g. created with `manage.py syncdb`). The command to load it with psql should be
of the form:
`psql -x -v ON_ERROR_STOP=1 -e -p5434 -Umaster -hlocalhost entosp_dbo_6_20150127 < ento.dump`
The ON_ERROR_STOP is beneficial in that it allows you determine where things have gone wrong.
This is WIP.
--Ben
=============
django-dumpdb
=============
``django-dumpdb`` saves and restored the contents of the database in a simple database-independent format.
It is designed to be fast and memory efficient, and can handle a database of
ANY size, in a reasonable time, with a fixed memory footprint.
Features
========
* Stream-oriented file format.
* Accesses the database directly, bypassing the ORM layer for better performance.
* Uses server-side database cursors to preserve memory.
* Can hanldle data with ``ForeignKey('self')`` and forward references.
Supported database backends
===========================
``django-dumpdb`` uses server-side cursors and deferred foreign key checks, which
is not supported by Django as of now. Therefore, it has to use some DB-specific
code. The following database backends are currently supported:
* ``postgresql_psycopg2``
* ``mysql``
* ``sqlite``
Installation
============
Add ``django_dumpdb`` to your ``INSTALLED_APPS``.
Usage
=====
::
manage.py dumpdb > db.dump
manage.py restoredb < db.dump
Or even::
ssh remotehost /var/www/myproject/manage.py dumpdb | manage.py restoredb
``django-dumpdb`` can also be used to migrate the data to another database (for
example, from MySQL to PostgreSQL).
Disclaimer
==========
USE THIS AT YOUR OWN RISK! THIS SOFTWARE MAY CONTAIN BUGS, AND MAY DESTROY YOUR
DATA AND KILL YOU PARENTS, EVEN IF USED CORRECTLY. YOU HAVE BEEN WARNED!