2021-08-20 09:27:19 +00:00
|
|
|
# discours-migration
|
|
|
|
|
|
|
|
First, put the `data` into this folder.
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
|
|
```sh
|
|
|
|
pipenv install -r requirements.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
## Using
|
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
Put the unpacked mongodump to the `data` folder and operate with
|
|
|
|
`pipenv shell && python`
|
2022-07-13 16:01:48 +00:00
|
|
|
#### get old data jsons
|
2021-08-20 09:27:19 +00:00
|
|
|
|
|
|
|
```py
|
|
|
|
import bson2json
|
|
|
|
|
|
|
|
bson2json.json_tables() # creates all the needed data json from bson mongodump
|
|
|
|
```
|
|
|
|
|
2022-07-13 16:01:48 +00:00
|
|
|
#### migrate all
|
|
|
|
|
|
|
|
```sh
|
|
|
|
pipenv install
|
|
|
|
pipenv run python migrate.py all
|
|
|
|
```
|
|
|
|
#### or migrate all with mdx exports
|
2021-08-20 09:27:19 +00:00
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
```sh
|
2021-08-23 08:44:46 +00:00
|
|
|
pipenv install
|
2022-07-13 16:01:48 +00:00
|
|
|
pipenv run python migrate.py all mdx
|
2021-08-20 23:17:15 +00:00
|
|
|
```
|
2021-08-21 00:40:41 +00:00
|
|
|
|
|
|
|
Note: this will create db entries and it is not tolerant to existed unique
|
|
|
|
email.
|
2021-08-20 09:27:19 +00:00
|
|
|
|
2022-07-13 16:01:48 +00:00
|
|
|
#### or one shout by slug
|
2021-08-20 09:27:19 +00:00
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
```sh
|
2022-07-13 16:01:48 +00:00
|
|
|
pipenv run python migrate.py - <shout-slug>
|
2021-08-20 23:17:15 +00:00
|
|
|
```
|