mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-30 00:03:30 +02:00
added documentation
This commit is contained in:
parent
80aca78194
commit
c5748c6bc1
1 changed files with 57 additions and 0 deletions
57
docs/operations/import_export.md
Normal file
57
docs/operations/import_export.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
# Export / Import Tables
|
||||
|
||||
A means is provided to export and import individual tables from
|
||||
one environment to another. This allows for replication of
|
||||
production data in a development environment. Import and export
|
||||
are provided through the django admin interface, through a modified
|
||||
library, django-import-export. Each supported model has an Import
|
||||
and an Export button on the list view.
|
||||
|
||||
### Export
|
||||
|
||||
When exporting models from the source environment, make sure that
|
||||
no filters are selected. This will ensure that all rows of the model
|
||||
are exported. Due to database dependencies, the following models
|
||||
need to be exported:
|
||||
|
||||
* User
|
||||
* Contact
|
||||
* Domain
|
||||
* DomainRequest
|
||||
* DomainInformation
|
||||
* DomainUserRole
|
||||
|
||||
### Import
|
||||
|
||||
When importing into the target environment, if the target environment
|
||||
is different than the source environment, it must be prepared for the
|
||||
import. This involves clearing out rows in the appropriate tables so
|
||||
that there are no database conflicts on import.
|
||||
|
||||
#### Preparing Target Environment
|
||||
|
||||
Delete all rows from tables in the following order through django admin:
|
||||
|
||||
* DomainInformation
|
||||
* DomainRequest
|
||||
* Domain
|
||||
* User (all but the current user)
|
||||
* Contact
|
||||
|
||||
It may not be necessary, but advisable to also remove rows from these tables:
|
||||
|
||||
* Websites
|
||||
* DraftDomain
|
||||
* Host
|
||||
|
||||
#### Importing into Target Environment
|
||||
|
||||
Once target environment is prepared, files can be imported in the following
|
||||
order:
|
||||
|
||||
* User
|
||||
* Contact
|
||||
* Domain
|
||||
* DomainRequest
|
||||
* DomainInformation
|
||||
* UserDomainRole
|
Loading…
Add table
Add a link
Reference in a new issue