Skip to content

Commit c8cb5cc

Browse files
committed
change name from SDE Indexing Helper to COSMOS
1 parent 7fcf45a commit c8cb5cc

File tree

10 files changed

+119
-12
lines changed

10 files changed

+119
-12
lines changed

SQLDumpRestoration.md

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,111 @@ docker-compose -f local.yml up
8282
docker-compose -f local.yml run --rm django python manage.py createsuperuser
8383
```
8484

85-
8. Log in to the SDE Indexing Helper frontend to ensure that all data has been correctly populated in the UI.
85+
8. Log in to the COSMOS frontend to ensure that all data has been correctly populated in the UI.
86+
87+
88+
89+
# making the backup
90+
91+
```bash
92+
ssh sde
93+
cat .envs/.production/.postgres
94+
```
95+
96+
find the values for the variables:
97+
POSTGRES_HOST=sde-indexing-helper-db.c3cr2yyh5zt0.us-east-1.rds.amazonaws.com
98+
POSTGRES_PORT=5432
99+
POSTGRES_DB=postgres
100+
POSTGRES_USER=postgres
101+
POSTGRES_PASSWORD=this_is_A_web_application_built_in_2023
102+
103+
```bash
104+
docker ps
105+
```
106+
107+
b3fefa2c19fb
108+
109+
note here that you need to put the
110+
```bash
111+
docker exec -t your_postgres_container_id pg_dump -U your_postgres_user -d your_database_name > backup.sql
112+
```
113+
```bash
114+
docker exec -t container_id pg_dump -h host -U user -d database -W > prod_backup.sql
115+
```
116+
117+
docker exec -t b3fefa2c19fb env PGPASSWORD="this_is_A_web_application_built_in_2023" pg_dump -h sde-indexing-helper-db.c3cr2yyh5zt0.us-east-1.rds.amazonaws.com -U postgres -d postgres > prod_backup.sql
118+
119+
# move the backup to local
120+
go back to local computer and scp the file
121+
122+
```bash
123+
scp sde:/home/ec2-user/sde_indexing_helper/prod_backup.sql .
124+
```
125+
scp prod_backup.sql sde_staging:/home/ec2-user/sde-indexing-helper
126+
if you have trouble transferring the file, you can use rsync:
127+
rsync -avzP prod_backup.sql sde_staging:/home/ec2-user/sde-indexing-helper/
128+
129+
# restoring the backup
130+
bring down the local containers
131+
```bash
132+
docker-compose -f local.yml down
133+
docker-compose -f local.yml up postgres
134+
docker ps
135+
```
136+
137+
find the container id
138+
139+
c11d7bae2e56
140+
141+
find the local variables from
142+
cat .envs/.production/.postgres
143+
POSTGRES_HOST=sde-indexing-helper-staging-db.c3cr2yyh5zt0.us-east-1.rds.amazonaws.com
144+
POSTGRES_PORT=5432
145+
POSTGRES_DB=sde_staging
146+
POSTGRES_USER=postgres
147+
POSTGRES_PASSWORD=postgres
148+
149+
150+
```bash
151+
docker exec -it <container id> bash
152+
```
153+
docker exec -it c11d7bae2e56 bash
154+
155+
## do all the database shit you need to
156+
157+
158+
psql -U <POSTGRES_USER> -d <POSTGRES_DB>
159+
psql -U postgres -d sde_staging
160+
or, if you are on one of the servers:
161+
psql -h sde-indexing-helper-staging-db.c3cr2yyh5zt0.us-east-1.rds.amazonaws.com -U postgres -d postgres
162+
163+
\c postgres
164+
DROP DATABASE sde_staging;
165+
CREATE DATABASE sde_staging;
166+
167+
# do the backup
168+
169+
```bash
170+
docker cp prod_backup.sql c11d7bae2e56:/
171+
docker exec -it c11d7bae2e56 bash
172+
```
173+
174+
```bash
175+
psql -U <POSTGRES_USER> -d <POSTGRES_DB> -f backup.sql
176+
```
177+
psql -U VnUvMKBSdkoFIETgLongnxYHrYVJKufn -d sde_indexing_helper -f prod_backup.sql
178+
179+
psql -h sde-indexing-helper-staging-db.c3cr2yyh5zt0.us-east-1.rds.amazonaws.com -U postgres -d postgres -f prod_backup.sql
180+
pg_restore -h sde-indexing-helper-staging-db.c3cr2yyh5zt0.us-east-1.rds.amazonaws.com -U postgres -d postgres prod_backup.sql
181+
182+
183+
184+
docker down
185+
186+
docker up build
187+
188+
migrate
189+
190+
down
191+
192+
up

config/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from django.urls import include, path
55
from django.views import defaults as default_views
66

7-
admin.site.site_header = "SDE Indexing Helper Administration" # default: "Django Administration"
8-
admin.site.index_title = "SDE Indexing Helper" # default: "Site administration"
9-
admin.site.site_title = "SDE Indexing Helper" # default: "Django site admin"
7+
admin.site.site_header = "COSMOS Administration" # default: "Django Administration"
8+
admin.site.index_title = "COSMOS" # default: "Site administration"
9+
admin.site.site_title = "COSMOS" # default: "Django site admin"
1010

1111
urlpatterns = [
1212
path("", include("sde_collections.urls", namespace="sde_collections")),

config/wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
WSGI config for SDE Indexing Helper project.
2+
WSGI config for COSMOS.
33
44
This module contains the WSGI application used by Django's development server
55
and any production WSGI deployments. It should expose a module-level variable

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
# -- Project information -----------------------------------------------------
3030

31-
project = "SDE Indexing Helper"
31+
project = "COSMOS"
3232
copyright = """2023, NASA IMPACT"""
3333
author = "NASA IMPACT"
3434

sde_indexing_helper/templates/account/signup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="card login-card">
1717
<div class="title-wrapper">
1818
<h4 class="card-title login-title">Lets Get Started!</h4>
19-
<p>Create an account for SDE Indexing Helper</p>
19+
<p>Create an account for COSMOS</p>
2020
</div>
2121
<div >
2222
<form id="signup_form" method="post" action="{% url 'account_signup' %}">

sde_indexing_helper/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta http-equiv="x-ua-compatible" content="ie=edge">
88
<title>
99
{% block title %}
10-
SDE Indexing Helper
10+
COSMOS
1111
{% endblock title %}
1212
</title>
1313
<meta name="viewport" content="width=device-width, initial-scale=1.0">

sde_indexing_helper/templates/includes/sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="logo">
77
<a rel="noopener noreferrer"
88
href="{% url 'sde_collections:list' %}"
9-
class="simple-text logo-normal">SDE Indexing Helper</a>
9+
class="simple-text logo-normal">COMSMOS</a>
1010
</div>
1111
<div class="sidebar-wrapper">
1212
<ul class="nav">

sde_indexing_helper/templates/layouts/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<title>
1111
{% block title %}
1212
{% endblock title %}
13-
| SDE Indexing Helper
13+
| COSMOS
1414
</title>
1515
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
1616
name='viewport' />

sde_indexing_helper/templates/layouts/base_auth.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<title>
1111
{% block title %}
1212
{% endblock title %}
13-
| SDE Indexing Helper
13+
| COSMOS
1414
</title>
1515
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
1616
name='viewport' />

sde_indexing_helper/users/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class User(AbstractUser):
88
"""
9-
Default custom user model for SDE Indexing Helper.
9+
Default custom user model for COSMOS.
1010
If adding fields that need to be filled at user signup,
1111
check forms.SignupForm and forms.SocialSignupForms accordingly.
1212
"""

0 commit comments

Comments
 (0)