You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2020/06/03 22:14:01 UTC

[airavata-django-portal] 02/02: Document how to replace wagtail export with another

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit e6ce2e7bb02bedb63c4d7990c66027a4a2dbe56d
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jun 3 18:13:46 2020 -0400

    Document how to replace wagtail export with another
---
 docs/dev/wagtail_export.md | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/docs/dev/wagtail_export.md b/docs/dev/wagtail_export.md
index 6238ef8..1ccacf2 100644
--- a/docs/dev/wagtail_export.md
+++ b/docs/dev/wagtail_export.md
@@ -154,3 +154,42 @@ python manage.py load_cms_data myexport.json
 
 where `myexport.json` should match the name that you gave the file when
 exporting it.
+
+## Replacing a Wagtail import with a different export
+
+Use this when you have already loaded a Wagtail export into a Django instance
+and you need to load a different one to overwrite the first one. The following
+steps will first remove the Wagtail tables and then load the export like normal.
+
+1. Make sure your virtual environment is activated if not already.
+
+```bash
+source venv/bin/activate
+```
+
+2. Run the following to delete all wagtail tables
+
+```bash
+python manage.py migrate wagtailimages 0001
+python manage.py migrate wagtailimages zero
+python manage.py migrate taggit zero
+python manage.py migrate wagtailadmin zero
+python manage.py migrate wagtailcore zero
+python manage.py migrate wagtailusers zero
+python manage.py migrate wagtailembeds zero
+```
+
+3. Migrate the database:
+
+```bash
+python manage.py migrate
+```
+
+4. Run
+
+```bash
+python manage.py load_cms_data myexport.json
+```
+
+where `myexport.json` should match the name that you gave the file when
+exporting it.