Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer the data from Firebase to Postgres #66

Closed
Matthias-Schaub opened this issue Jan 23, 2019 · 4 comments
Closed

Transfer the data from Firebase to Postgres #66

Matthias-Schaub opened this issue Jan 23, 2019 · 4 comments

Comments

@Matthias-Schaub
Copy link
Contributor

Write a script which transfers the data from the Firebase instance to the Postgres database

@maze2point0
Copy link
Collaborator

maze2point0 commented Jan 24, 2019

So far we only stored results and users in mysql along with projects but only 3 attributes there.

As the rewritten, now modular python mapswipe workers in addition store all infos on projects as well as now groups and tasks and imports in postgres. We need to import all the respective tables which are in firebase only for now:

  • - imports table
  • - projects table
  • - groups table
  • - tasks table

@Hagellach37
Copy link
Member

what about the users in firebase?

@maze2point0
Copy link
Collaborator

users included in the script now as well.

ran into an error related to paths. When I move the script from mapswipe-workers/utils to /
I am able to execute it without any problems

root@ac4e988aa869:/python-mapswipe-workers# python mapswipe_workers/utils/import_firebase_to_psql.py -op download
/usr/local/lib/python3.6/site-packages/psycopg2-2.7.6.1-py3.6-linux-x86_64.egg/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
  """)
Traceback (most recent call last):
  File "mapswipe_workers/utils/import_firebase_to_psql.py", line 369, in <module>
    firebase, postgres = b.get_environment(args.modus)
  File "/usr/local/lib/python3.6/site-packages/mapswipe_workers-0.0.2-py3.6.egg/mapswipe_workers/basic/BaseFunctions.py", line 49, in get_environment
    firebase = auth.dev_firebase_admin_auth()
  File "/usr/local/lib/python3.6/site-packages/mapswipe_workers-0.0.2-py3.6.egg/mapswipe_workers/basic/auth.py", line 57, in dev_firebase_admin_auth
    CONFIG = load_config()
  File "/usr/local/lib/python3.6/site-packages/mapswipe_workers-0.0.2-py3.6.egg/mapswipe_workers/basic/auth.py", line 23, in load_config
    with open(CONFIG_PATH) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/mapswipe_workers-0.0.2-py3.6.egg/cfg/configuration.json'

@maze2point0
Copy link
Collaborator

I added a report script which checks for consistency between firebase and postgres.
303cff9

Transition to the new version of Mapswipe Workers automation moved this from Import Process to Done Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants