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

synapse_port_db throws python module error #18105

Closed
Videothek opened this issue Jan 22, 2025 · 1 comment
Closed

synapse_port_db throws python module error #18105

Videothek opened this issue Jan 22, 2025 · 1 comment

Comments

@Videothek
Copy link

Videothek commented Jan 22, 2025

Description

When trying to migrate from sqlite to postgres using the provided script on Ubuntu:
synapse_port_db --sqlite-database homeserver.db.snapshot --postgres-config homeserver-postgres.yaml

It threw the error that the script couldn't find the synapse module, so i installed it like this:
sudo python3 -m pip install --target=/usr/lib/python3.12 synapse

When running the script after that, it throws the following:

Traceback (most recent call last):
  File "/usr/local/bin/synapse_port_db", line 31, in <module>
    from synapse.config.database import DatabaseConnectionConfig
ModuleNotFoundError: No module named 'synapse.config'

Steps to reproduce

  • Follow the Guide to use the script
  • Install synapse module for python3: sudo python3 -m pip install --target=/usr/lib/python3.12 synapse

Homeserver

Synapse self-hosted

Synapse Version

1.118.0

Installation Method

Debian packages from packages.matrix.org

Database

SQLite

Workers

Single process

Platform

Ubuntu 24.04 LTS

Configuration

Basic homeserver.yml config

Relevant log output

Traceback (most recent call last):
  File "/usr/local/bin/synapse_port_db", line 31, in <module>
    from synapse.config.database import DatabaseConnectionConfig
ModuleNotFoundError: No module named 'synapse.config'

Anything else that would be useful to know?

No response

@Videothek
Copy link
Author

Ok so it was a Layer 8 problem 😅.

I hade to change to the python environment: source /opt/venvs/matrix-synapse/bin/activate
And then run the script again.

Unfortunatly i had the same error as here: #18053
Thats why i reinstalled matrix since none of the workarounds worked for me 😢.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant